Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudux-starter-kit",
"version": "2.1.13",
"version": "2.2.2",
"description": "Starter kit for UI developers in CloudUX",
"main": "build/index.js",
"scripts": {
Expand All @@ -21,14 +21,12 @@
"license": "SEE LICENSE IN EULA.md",
"dependencies": {
"base64-img": "1.0.4",
"cloudux-starter-kit": "2.1.13",
"mediacentral-publish": "^0.3.2",
"mediacentral-sign": "^0.1.1"
"cloudux-starter-kit": "2.2.2"
},
"devDependencies": {
"autoprefixer": "9.6.1",
"babel-core": "6.26.3",
"babel-eslint": "8.2.6",
"babel-eslint": "9.x",
"babel-loader": "7.1.5",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-decorators": "6.24.1",
Expand All @@ -45,8 +43,9 @@
"eslint-plugin-flowtype": "2.50.3",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.2.3",
"file-loader": "6.2.0",
"html-loader": "0.5.5",
"http-proxy-middleware": "0.18.0",
"http-proxy-middleware": "^2.0.6",
"mini-css-extract-plugin": "0.4.4",
"node-fetch": "^2.6.1",
"postcss-loader": "3.0.0",
Expand Down
11 changes: 5 additions & 6 deletions src/app/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
/**
* Copyright 2017 by Avid Technology, Inc.
* Copyright 2022 by Avid Technology, Inc.
*/
import { getLocalization } from './localization';
import l10nData from '../l10n/lang.en.json';

export default class ApplicationContainer {
constructor() {
this.div = document.createElement('div');
this.div.innerHTML = getLocalization(l10nData)('example-plugin-message');
getTitle() {
return 'Your first AVID app title';
}

returnElement() {
return this.div;
render(element) {
element.innerHTML = getLocalization(l10nData)('example-plugin-message');
}
}
10 changes: 5 additions & 5 deletions src/avid_api/entry/EntryWrapper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2017 by Avid Technology, Inc.
* Copyright 2022 by Avid Technology, Inc.
*/
import appConfig from '../../package.json';

Expand Down Expand Up @@ -36,10 +36,6 @@ export default class EntryApp {
console.log('[ExamplePlugin] onHide');
}

onUnrender() {
console.log('[ExamplePlugin] onUnrender');
}

onBeforeUnrender() {
console.log('[ExamplePlugin] onBeforeUnrender');
}
Expand All @@ -51,6 +47,10 @@ export default class EntryApp {
setContext(context) {
console.log('[ExamplePlugin] context', context);
}

getTitle() {
return this.innerView.getTitle();
}

get publicScope() {
return {};
Expand Down
32 changes: 16 additions & 16 deletions src/avid_api/view/ViewWrapper.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
/**
* Copyright 2017 by Avid Technology, Inc.
* Copyright 2022 by Avid Technology, Inc.
*/
/* eslint-disable */

import ApplicationContainer from '../../app/index';

// Need to be bcs it is used in main App :
export default class ViewWrapper {
createElement() {
this.el = document.createElement('div');
return Promise.resolve(this.el);
}

onInit() {
this.pane = new ApplicationContainer({
contextCallback: function (context) {
this.trigger('contextChange', context);
}.bind(this),
});
onInit(config, { dispatch }) {
this.trigger = dispatch;
this.state = config.state;
}

onRender() {
this.el.appendChild(this.pane.returnElement());
onRender({ domElement }) {
this.el = document.createElement('div');
this.pane = new ApplicationContainer();
this.pane.render(this.el);
domElement.appendChild(this.el);
}

onDestroy(data) {}
Expand Down Expand Up @@ -60,7 +54,13 @@ export default class ViewWrapper {
return 50;
}

getTitle() {
return this.pane && this.pane.getTitle();
}

get publicScope() {
return {};
return {
getTitle: this.getTitle.bind(this),
};
}
}
11 changes: 7 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2017 by Avid Technology, Inc.
* Copyright 2022 by Avid Technology, Inc.
*/

import appConfig from './package.json';
Expand All @@ -9,14 +9,17 @@ import AppEntry from './avid_api/entry/EntryConfig';
import Action from './app/action';
import Binding from './app/binding';

const isAdminApp = appConfig.avid.hasOwnProperty('mode') && appConfig.avid.mode[0] === 'admin';
const providing = isAdminApp ? 'adminApps' : 'apps';

export const avid = [
{
name: `${appConfig.identity.appName}-view`,
provides: ['views'],
provides: ['appViews'],
create: () => ViewConfig,
},
{
name: `${appConfig.identity.appName}-view`,
name: `${appConfig.identity.appName}-default-theme`,
provides: ['theme'],
create: () => ({
key: 'dark',
Expand All @@ -25,7 +28,7 @@ export const avid = [
},
{
name: appConfig.identity.appName,
provides: ['apps'],
provides: [providing],
create: () => AppEntry,
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"avid": {
"format": "amd",
"autoload": true,
"autoload": false,
"alias": "your-avid-app-id",
"secret": "your-app-secred-from-myavid-com",
"features": {
Expand Down