neo.mjs 6.17.1 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/ServiceWorker.mjs +3 -5
- package/apps/colors/README.md +8 -0
- package/apps/colors/app.mjs +6 -0
- package/apps/colors/childapps/widget/app.mjs +7 -0
- package/apps/colors/childapps/widget/index.html +11 -0
- package/apps/colors/childapps/widget/neo-config.json +10 -0
- package/apps/colors/childapps/widget/view/Viewport.mjs +19 -0
- package/apps/colors/index.html +11 -0
- package/apps/colors/model/Color.mjs +43 -0
- package/apps/colors/neo-config.json +10 -0
- package/apps/colors/remotes-api.json +13 -0
- package/apps/colors/store/Colors.mjs +24 -0
- package/apps/colors/view/BarChartComponent.mjs +64 -0
- package/apps/colors/view/HeaderToolbar.mjs +95 -0
- package/apps/colors/view/PieChartComponent.mjs +58 -0
- package/apps/colors/view/TableContainer.mjs +91 -0
- package/apps/colors/view/Viewport.mjs +57 -0
- package/apps/colors/view/ViewportController.mjs +277 -0
- package/apps/colors/view/ViewportModel.mjs +53 -0
- package/apps/portal/Util.mjs +11 -0
- package/apps/portal/childapps/preview/neo-config.json +2 -2
- package/apps/portal/neo-config.json +2 -1
- package/apps/portal/remotes-api.json +13 -0
- package/apps/portal/view/HeaderToolbar.mjs +44 -27
- package/apps/portal/view/Viewport.mjs +12 -1
- package/apps/portal/view/ViewportController.mjs +89 -1
- package/apps/portal/view/home/MainContainer.mjs +27 -60
- package/apps/portal/view/home/parts/AfterMath.mjs +58 -0
- package/apps/portal/view/home/parts/Colors.mjs +74 -0
- package/apps/portal/view/home/parts/Features.mjs +52 -0
- package/apps/portal/view/home/parts/Helix.mjs +75 -0
- package/apps/portal/view/home/parts/HelloWorld.mjs +82 -0
- package/apps/portal/view/home/parts/MainNeo.mjs +55 -0
- package/apps/portal/view/home/preview/PageCodeContainer.mjs +55 -0
- package/apps/portal/view/learn/LivePreview.mjs +72 -29
- package/apps/portal/view/learn/MainContainerController.mjs +10 -90
- package/apps/realworld/api/Article.mjs +1 -3
- package/apps/realworld/api/Favorite.mjs +1 -3
- package/apps/realworld/api/Profile.mjs +1 -3
- package/apps/realworld/api/Tag.mjs +1 -3
- package/apps/realworld/api/User.mjs +1 -3
- package/apps/realworld2/api/Article.mjs +1 -3
- package/apps/realworld2/api/Favorite.mjs +1 -3
- package/apps/realworld2/api/Profile.mjs +1 -3
- package/apps/realworld2/api/Tag.mjs +1 -3
- package/apps/realworld2/api/User.mjs +1 -3
- package/apps/realworld2/view/article/HelixContainer.mjs +5 -5
- package/buildScripts/webpack/json/myApps.template.json +1 -0
- package/buildScripts/webpack/webpack.server.config.mjs +4 -1
- package/docs/app/view/MainContainer.mjs +5 -0
- package/docs/app/view/classdetails/MembersList.mjs +1 -1
- package/examples/ServiceWorker.mjs +3 -5
- package/examples/component/helix/Viewport.mjs +309 -0
- package/examples/component/helix/ViewportController.mjs +122 -0
- package/examples/component/helix/app.mjs +2 -2
- package/examples/component/helix/neo-config.json +0 -1
- package/examples/component/multiWindowHelix/Viewport.mjs +11 -3
- package/examples/component/multiWindowHelix/ViewportController.mjs +21 -9
- package/examples/component/multiWindowHelix/neo-config.json +0 -1
- package/examples/fieldWithPrefix/MainContainer.mjs +1 -6
- package/examples/list/animate/MainContainerController.mjs +1 -1
- package/examples/worker/task/MyTasks.mjs +1 -3
- package/package.json +5 -5
- package/resources/data/deck/learnneo/pages/GuideEvents.md +131 -0
- package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +1 -1
- package/resources/images/logo/neo_logo_primary.svg +6 -0
- package/resources/images/logo/neo_logo_secondary.svg +6 -0
- package/resources/images/logo/neo_logo_text_primary.svg +5 -0
- package/resources/images/logo/neo_logo_text_secondary.svg +5 -0
- package/resources/images/logo/neo_logo_white.svg +6 -0
- package/resources/scss/src/apps/colors/BarChartComponent.scss +3 -0
- package/resources/scss/src/apps/colors/HeaderToolbar.scss +11 -0
- package/resources/scss/src/apps/colors/PieChartComponent.scss +3 -0
- package/resources/scss/src/apps/colors/TableContainer.scss +64 -0
- package/resources/scss/src/apps/colors/Viewport.scss +9 -0
- package/resources/scss/src/apps/portal/HeaderToolbar.scss +189 -17
- package/resources/scss/src/apps/portal/home/MainContainer.scss +46 -20
- package/resources/scss/src/apps/portal/home/parts/Features.scss +3 -0
- package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +115 -0
- package/resources/scss/src/component/Base.scss +2 -0
- package/resources/scss/src/examples/component/multiWindowHelix/Viewport.scss +3 -0
- package/resources/scss/src/form/field/CheckBox.scss +1 -0
- package/resources/scss/src/tab/header/Button.scss +2 -1
- package/resources/scss/theme-dark/Global.scss +8 -0
- package/resources/scss/theme-dark/button/Base.scss +1 -1
- package/resources/scss/theme-dark/tab/header/Button.scss +1 -0
- package/resources/scss/theme-light/Global.scss +8 -0
- package/resources/scss/theme-light/button/Base.scss +1 -1
- package/resources/scss/theme-light/tab/header/Button.scss +1 -0
- package/resources/scss/theme-neo-light/Global.scss +53 -53
- package/resources/scss/theme-neo-light/button/Base.scss +3 -4
- package/resources/scss/theme-neo-light/tab/header/Button.scss +6 -8
- package/src/DefaultConfig.mjs +2 -2
- package/src/Fetch.mjs +1 -3
- package/src/Main.mjs +13 -11
- package/src/MicroLoader.mjs +2 -2
- package/src/Neo.mjs +27 -26
- package/src/Xhr.mjs +1 -3
- package/src/button/Base.mjs +6 -4
- package/src/button/Split.mjs +10 -9
- package/src/calendar/view/EditEventContainer.mjs +13 -12
- package/src/calendar/view/MainContainer.mjs +40 -40
- package/src/calendar/view/MainContainerModel.mjs +5 -5
- package/src/calendar/view/SettingsContainer.mjs +11 -11
- package/src/calendar/view/YearComponent.mjs +73 -75
- package/src/calendar/view/calendars/ColorsList.mjs +2 -2
- package/src/calendar/view/calendars/EditContainer.mjs +2 -2
- package/src/calendar/view/calendars/List.mjs +12 -13
- package/src/calendar/view/month/Component.mjs +72 -73
- package/src/calendar/view/settings/GeneralContainer.mjs +5 -5
- package/src/calendar/view/settings/MonthContainer.mjs +5 -5
- package/src/calendar/view/settings/WeekContainer.mjs +6 -6
- package/src/calendar/view/settings/YearContainer.mjs +4 -4
- package/src/calendar/view/week/Component.mjs +47 -57
- package/src/calendar/view/week/EventDragZone.mjs +43 -50
- package/src/calendar/view/week/TimeAxisComponent.mjs +21 -21
- package/src/calendar/view/week/plugin/DragDrop.mjs +53 -45
- package/src/calendar/view/week/plugin/EventResizable.mjs +8 -3
- package/src/collection/Base.mjs +15 -22
- package/src/collection/Filter.mjs +4 -9
- package/src/collection/Sorter.mjs +6 -7
- package/src/component/Base.mjs +149 -87
- package/src/component/Canvas.mjs +9 -9
- package/src/component/Carousel.mjs +31 -33
- package/src/component/Chip.mjs +9 -9
- package/src/component/Circle.mjs +84 -91
- package/src/component/Clock.mjs +8 -8
- package/src/component/DateSelector.mjs +14 -15
- package/src/component/Gallery.mjs +82 -80
- package/src/component/Helix.mjs +131 -126
- package/src/component/Iframe.mjs +1 -1
- package/src/component/Label.mjs +1 -1
- package/src/component/Legend.mjs +3 -3
- package/src/component/Process.mjs +39 -37
- package/src/component/Splitter.mjs +9 -11
- package/src/component/StatusBadge.mjs +2 -3
- package/src/component/Timer.mjs +62 -68
- package/src/component/Toast.mjs +11 -11
- package/src/component/Video.mjs +7 -8
- package/src/component/mwc/Button.mjs +10 -10
- package/src/component/mwc/TextField.mjs +17 -17
- package/src/component/wrapper/AmChart.mjs +5 -5
- package/src/component/wrapper/CesiumJS.mjs +11 -17
- package/src/component/wrapper/GoogleMaps.mjs +58 -35
- package/src/component/wrapper/MapboxGL.mjs +112 -79
- package/src/component/wrapper/MonacoEditor.mjs +1 -6
- package/src/container/Accordion.mjs +18 -20
- package/src/container/AccordionItem.mjs +12 -11
- package/src/container/Base.mjs +29 -28
- package/src/container/Panel.mjs +9 -9
- package/src/container/Viewport.mjs +30 -1
- package/src/controller/Base.mjs +12 -14
- package/src/controller/Component.mjs +60 -66
- package/src/core/Base.mjs +5 -8
- package/src/core/IdGenerator.mjs +1 -3
- package/src/core/Observable.mjs +17 -17
- package/src/core/Util.mjs +5 -5
- package/src/data/Model.mjs +3 -3
- package/src/data/RecordFactory.mjs +3 -6
- package/src/data/Store.mjs +34 -34
- package/src/data/connection/Fetch.mjs +3 -3
- package/src/data/connection/WebSocket.mjs +21 -25
- package/src/data/connection/Xhr.mjs +31 -28
- package/src/date/DayViewComponent.mjs +1 -1
- package/src/date/SelectorContainer.mjs +2 -2
- package/src/dialog/Base.mjs +27 -25
- package/src/dialog/header/Toolbar.mjs +5 -4
- package/src/draggable/DragProxyComponent.mjs +7 -4
- package/src/draggable/DragZone.mjs +30 -30
- package/src/draggable/DropZone.mjs +7 -7
- package/src/draggable/list/DragZone.mjs +18 -18
- package/src/draggable/tab/header/toolbar/SortZone.mjs +7 -7
- package/src/draggable/toolbar/DragZone.mjs +15 -15
- package/src/draggable/toolbar/SortZone.mjs +30 -31
- package/src/draggable/tree/DragZone.mjs +9 -9
- package/src/filter/BooleanContainer.mjs +3 -3
- package/src/filter/NumberContainer.mjs +5 -5
- package/src/filter/ToggleOperatorsButton.mjs +5 -5
- package/src/form/Fieldset.mjs +26 -26
- package/src/form/field/Base.mjs +1 -1
- package/src/form/field/CheckBox.mjs +15 -16
- package/src/form/field/Color.mjs +13 -15
- package/src/form/field/ComboBox.mjs +16 -24
- package/src/form/field/Country.mjs +1 -1
- package/src/form/field/Date.mjs +3 -4
- package/src/form/field/Display.mjs +1 -1
- package/src/form/field/Email.mjs +2 -2
- package/src/form/field/Number.mjs +51 -56
- package/src/form/field/Picker.mjs +2 -2
- package/src/form/field/Radio.mjs +1 -1
- package/src/form/field/Range.mjs +7 -6
- package/src/form/field/Text.mjs +29 -36
- package/src/form/field/TextArea.mjs +9 -9
- package/src/form/field/Time.mjs +30 -30
- package/src/form/field/trigger/Base.mjs +19 -13
- package/src/form/field/trigger/Clear.mjs +13 -13
- package/src/form/field/trigger/CopyToClipboard.mjs +7 -7
- package/src/form/field/trigger/Picker.mjs +2 -2
- package/src/form/field/trigger/SpinDown.mjs +1 -1
- package/src/form/field/trigger/SpinUp.mjs +1 -1
- package/src/form/field/trigger/SpinUpDown.mjs +3 -3
- package/src/form/field/trigger/Time.mjs +3 -3
- package/src/grid/Container.mjs +33 -33
- package/src/grid/View.mjs +20 -22
- package/src/grid/header/Button.mjs +12 -12
- package/src/grid/header/Toolbar.mjs +4 -4
- package/src/layout/Base.mjs +5 -4
- package/src/layout/Card.mjs +15 -16
- package/src/layout/Fit.mjs +22 -8
- package/src/layout/Flexbox.mjs +30 -29
- package/src/layout/Form.mjs +15 -15
- package/src/layout/Grid.mjs +2 -2
- package/src/layout/HBox.mjs +3 -2
- package/src/layout/VBox.mjs +3 -2
- package/src/list/Base.mjs +45 -47
- package/src/list/Chip.mjs +4 -4
- package/src/list/Circle.mjs +3 -3
- package/src/list/Color.mjs +4 -4
- package/src/list/Component.mjs +10 -10
- package/src/list/plugin/Animate.mjs +18 -13
- package/src/main/DomAccess.mjs +92 -56
- package/src/main/DomEvents.mjs +38 -39
- package/src/main/addon/AmCharts.mjs +37 -37
- package/src/main/addon/AnalyticsByGoogle.mjs +4 -4
- package/src/main/addon/CesiumJS.mjs +8 -8
- package/src/main/addon/CloneNode.mjs +5 -5
- package/src/main/addon/Cookie.mjs +4 -4
- package/src/main/addon/DragDrop.mjs +35 -34
- package/src/main/addon/GoogleMaps.mjs +19 -19
- package/src/main/addon/LocalStorage.mjs +3 -3
- package/src/main/addon/MapboxGL.mjs +40 -41
- package/src/main/addon/MonacoEditor.mjs +5 -5
- package/src/main/addon/Mwc.mjs +6 -6
- package/src/main/addon/Navigator.mjs +35 -39
- package/src/main/addon/Popover.mjs +5 -6
- package/src/main/addon/PrefixField.mjs +1 -2
- package/src/main/addon/ServiceWorker.mjs +9 -9
- package/src/main/addon/Siesta.mjs +3 -2
- package/src/main/addon/Stylesheet.mjs +37 -37
- package/src/main/addon/WebComponent.mjs +2 -3
- package/src/main/addon/WindowPosition.mjs +18 -18
- package/src/main/draggable/sensor/Base.mjs +2 -2
- package/src/main/draggable/sensor/Mouse.mjs +15 -15
- package/src/main/draggable/sensor/Touch.mjs +24 -23
- package/src/main/mixin/DeltaUpdates.mjs +10 -12
- package/src/main/mixin/TouchDomEvents.mjs +6 -6
- package/src/manager/Base.mjs +4 -4
- package/src/manager/Component.mjs +41 -41
- package/src/manager/DomEvent.mjs +52 -50
- package/src/manager/Focus.mjs +14 -16
- package/src/manager/Instance.mjs +2 -4
- package/src/manager/Store.mjs +4 -8
- package/src/manager/Task.mjs +20 -22
- package/src/manager/Toast.mjs +14 -16
- package/src/manager/rpc/Api.mjs +1 -3
- package/src/manager/rpc/Message.mjs +16 -18
- package/src/menu/List.mjs +16 -16
- package/src/menu/Panel.mjs +4 -4
- package/src/model/Component.mjs +5 -5
- package/src/plugin/Base.mjs +2 -0
- package/src/plugin/Popover.mjs +1 -1
- package/src/plugin/PrefixField.mjs +35 -45
- package/src/plugin/Resizable.mjs +86 -101
- package/src/plugin/Responsive.mjs +175 -0
- package/src/remotes/Api.mjs +4 -6
- package/src/selection/CircleModel.mjs +12 -16
- package/src/selection/DateSelectorModel.mjs +21 -23
- package/src/selection/GalleryModel.mjs +49 -63
- package/src/selection/HelixModel.mjs +35 -41
- package/src/selection/ListModel.mjs +9 -14
- package/src/selection/Model.mjs +31 -31
- package/src/selection/TreeAccordionModel.mjs +74 -80
- package/src/selection/grid/CellColumnModel.mjs +10 -10
- package/src/selection/grid/CellColumnRowModel.mjs +10 -10
- package/src/selection/grid/CellModel.mjs +26 -28
- package/src/selection/grid/CellRowModel.mjs +24 -24
- package/src/selection/grid/ColumnModel.mjs +16 -20
- package/src/selection/grid/RowModel.mjs +27 -29
- package/src/selection/menu/ListModel.mjs +2 -2
- package/src/selection/table/CellColumnModel.mjs +12 -12
- package/src/selection/table/CellColumnRowModel.mjs +12 -12
- package/src/selection/table/CellModel.mjs +26 -29
- package/src/selection/table/CellRowModel.mjs +19 -19
- package/src/selection/table/ColumnModel.mjs +18 -22
- package/src/selection/table/RowModel.mjs +27 -29
- package/src/sitemap/Component.mjs +20 -20
- package/src/sitemap/Store.mjs +1 -1
- package/src/tab/Container.mjs +15 -15
- package/src/tab/Strip.mjs +1 -1
- package/src/tab/header/Toolbar.mjs +4 -4
- package/src/table/Container.mjs +8 -10
- package/src/table/View.mjs +29 -34
- package/src/table/header/Button.mjs +18 -18
- package/src/table/header/Toolbar.mjs +2 -2
- package/src/toolbar/Base.mjs +14 -14
- package/src/toolbar/Breadcrumb.mjs +11 -11
- package/src/toolbar/Paging.mjs +18 -18
- package/src/tooltip/Base.mjs +20 -22
- package/src/tree/Accordion.mjs +69 -75
- package/src/tree/List.mjs +22 -25
- package/src/util/Array.mjs +19 -18
- package/src/util/ClassSystem.mjs +9 -9
- package/src/util/Css.mjs +2 -2
- package/src/util/Date.mjs +9 -9
- package/src/util/Function.mjs +2 -2
- package/src/util/HashHistory.mjs +3 -5
- package/src/util/KeyNavigation.mjs +17 -17
- package/src/util/Logger.mjs +9 -9
- package/src/util/Matrix.mjs +19 -19
- package/src/util/String.mjs +9 -9
- package/src/util/Style.mjs +11 -11
- package/src/util/VDom.mjs +12 -14
- package/src/util/VNode.mjs +29 -29
- package/src/vdom/Helper.mjs +84 -93
- package/src/vdom/VNode.mjs +1 -1
- package/src/worker/App.mjs +19 -16
- package/src/worker/Base.mjs +14 -15
- package/src/worker/Canvas.mjs +1 -3
- package/src/worker/Data.mjs +4 -8
- package/src/worker/Manager.mjs +27 -32
- package/src/worker/Message.mjs +1 -1
- package/src/worker/ServiceBase.mjs +38 -42
- package/src/worker/Task.mjs +1 -3
- package/src/worker/VDom.mjs +2 -4
- package/src/worker/mixin/RemoteMethodAccess.mjs +5 -6
- package/examples/component/helix/MainContainer.mjs +0 -340
- package/resources/images/Neo_Vector.svg +0 -3
- package/resources/images/logos/Github-logo-black.svg +0 -1
- package/resources/images/logos/Slack-logo-black.svg +0 -17
@@ -12,6 +12,14 @@ const
|
|
12
12
|
* @extends Neo.container.Base
|
13
13
|
*/
|
14
14
|
class LivePreview extends Container {
|
15
|
+
/**
|
16
|
+
* Valid values for iconPosition
|
17
|
+
* @member {String[]} activeViews=['preview','source']
|
18
|
+
* @protected
|
19
|
+
* @static
|
20
|
+
*/
|
21
|
+
static activeViews = ['preview', 'source']
|
22
|
+
|
15
23
|
static config = {
|
16
24
|
/**
|
17
25
|
* @member {String} className='Portal.view.learn.LivePreview'
|
@@ -23,13 +31,19 @@ class LivePreview extends Container {
|
|
23
31
|
* @protected
|
24
32
|
*/
|
25
33
|
ntype: 'live-preview',
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
34
|
+
/**
|
35
|
+
* Valid values are 'preview' and 'source'
|
36
|
+
* @member {String} activeView_='source'
|
37
|
+
*/
|
38
|
+
activeView_: 'source',
|
39
|
+
|
40
|
+
baseCls : ['learn-live-preview'],
|
41
|
+
value_ : null,
|
42
|
+
autoMount : true,
|
43
|
+
autoRender : true,
|
44
|
+
disableRunSource: false,
|
45
|
+
height : 400,
|
46
|
+
layout : 'fit',
|
33
47
|
/**
|
34
48
|
* @member {Object[]} items
|
35
49
|
*/
|
@@ -75,7 +89,17 @@ class LivePreview extends Container {
|
|
75
89
|
* @returns {Neo.component.Base|null}
|
76
90
|
*/
|
77
91
|
get tabContainer() {
|
78
|
-
return this.
|
92
|
+
return this.getItem('tab-container')
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Triggered after the activeView config got changed
|
97
|
+
* @param {String} value
|
98
|
+
* @param {String} oldValue
|
99
|
+
* @protected
|
100
|
+
*/
|
101
|
+
afterSetActiveView(value, oldValue) {
|
102
|
+
this.tabContainer.activeIndex = value === 'source' ? 0 : 1
|
79
103
|
}
|
80
104
|
|
81
105
|
/**
|
@@ -90,6 +114,17 @@ class LivePreview extends Container {
|
|
90
114
|
}
|
91
115
|
}
|
92
116
|
|
117
|
+
/**
|
118
|
+
* Triggered before the activeView config gets changed
|
119
|
+
* @param {String} value
|
120
|
+
* @param {String} oldValue
|
121
|
+
* @returns {String}
|
122
|
+
* @protected
|
123
|
+
*/
|
124
|
+
beforeSetActiveView(value, oldValue) {
|
125
|
+
return this.beforeSetEnumValue(value, oldValue, 'activeView')
|
126
|
+
}
|
127
|
+
|
93
128
|
/**
|
94
129
|
*
|
95
130
|
*/
|
@@ -115,10 +150,12 @@ class LivePreview extends Container {
|
|
115
150
|
*
|
116
151
|
*/
|
117
152
|
doRunSource() {
|
118
|
-
|
119
|
-
|
153
|
+
if (this.disableRunSource) {
|
154
|
+
return
|
155
|
+
}
|
120
156
|
|
121
|
-
|
157
|
+
let me = this,
|
158
|
+
source = me.editorValue || me.value,
|
122
159
|
cleanLines = [],
|
123
160
|
importModuleNames = [],
|
124
161
|
moduleNameAndPath = [],
|
@@ -137,7 +174,7 @@ class LivePreview extends Container {
|
|
137
174
|
} else if (line.match(exportRegex)) {
|
138
175
|
// Skip export statements
|
139
176
|
} else {
|
140
|
-
cleanLines.push(line);
|
177
|
+
cleanLines.push(` ${line}`);
|
141
178
|
}
|
142
179
|
});
|
143
180
|
|
@@ -161,21 +198,23 @@ class LivePreview extends Container {
|
|
161
198
|
|
162
199
|
let promises = moduleNameAndPath.map(item => {
|
163
200
|
params.push(`${item.moduleName}Module`);
|
164
|
-
vars.push(`const ${item.moduleName} = ${item.moduleName}Module.default
|
165
|
-
return `import(
|
201
|
+
vars.push(` const ${item.moduleName} = ${item.moduleName}Module.default;`);
|
202
|
+
return `import('${item.path}')`
|
166
203
|
});
|
167
204
|
|
168
|
-
const codeString =
|
169
|
-
Promise.all([
|
170
|
-
|
171
|
-
])
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
205
|
+
const codeString = [
|
206
|
+
'Promise.all([',
|
207
|
+
` ${promises.join(',\n')}`,
|
208
|
+
`]).then(([${params.join(', ')}]) => {`,
|
209
|
+
`${vars.join('\n')}`,
|
210
|
+
` ${cleanLines.join('\n')}`,
|
211
|
+
'',
|
212
|
+
` if (${className} && Neo.component.Base.isPrototypeOf(${className})) {`,
|
213
|
+
` container.add({module:${className}})`,
|
214
|
+
' }',
|
215
|
+
'})',
|
216
|
+
'.catch(error => container.add({ntype:\'component\', html:error.message}));'
|
217
|
+
].join('\n')
|
179
218
|
|
180
219
|
const container = me.getPreviewContainer();
|
181
220
|
container.removeAll();
|
@@ -233,6 +272,7 @@ class LivePreview extends Container {
|
|
233
272
|
}
|
234
273
|
|
235
274
|
this.getReference('popout-window-button').hidden = data.value !== 1
|
275
|
+
this.disableRunSource = false;
|
236
276
|
}
|
237
277
|
|
238
278
|
/**
|
@@ -241,8 +281,8 @@ class LivePreview extends Container {
|
|
241
281
|
onConstructed() {
|
242
282
|
super.onConstructed();
|
243
283
|
|
244
|
-
let me
|
245
|
-
tabContainer = me
|
284
|
+
let me = this,
|
285
|
+
{tabContainer} = me;
|
246
286
|
|
247
287
|
// we want to add a normal (non-header) button
|
248
288
|
tabContainer.getTabBar().add({
|
@@ -254,7 +294,10 @@ class LivePreview extends Container {
|
|
254
294
|
ui : 'ghost'
|
255
295
|
});
|
256
296
|
|
257
|
-
tabContainer.on('activeIndexChange', me.onActiveIndexChange, me)
|
297
|
+
tabContainer.on('activeIndexChange', me.onActiveIndexChange, me);
|
298
|
+
|
299
|
+
// changing the activeView initially will not trigger our onActiveIndexChange() logic
|
300
|
+
me.activeView === 'preview' && me.doRunSource()
|
258
301
|
}
|
259
302
|
|
260
303
|
/**
|
@@ -267,7 +310,7 @@ class LivePreview extends Container {
|
|
267
310
|
await me.createPopupWindow();
|
268
311
|
|
269
312
|
// this component requires a view controller to manage connected apps
|
270
|
-
me.getController()?.connectedApps.push(me.id)
|
313
|
+
me.getController('viewport-controller')?.connectedApps.push(me.id)
|
271
314
|
}
|
272
315
|
}
|
273
316
|
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import Controller
|
1
|
+
import Controller from '../../../../src/controller/Component.mjs';
|
2
|
+
import {getSearchParams} from '../../Util.mjs';
|
2
3
|
|
3
4
|
/**
|
4
5
|
* @class Portal.view.learn.MainContainerController
|
@@ -19,41 +20,24 @@ class MainContainerController extends Controller {
|
|
19
20
|
}
|
20
21
|
}
|
21
22
|
|
22
|
-
/**
|
23
|
-
* @member {String[]} connectedApps=[]
|
24
|
-
*/
|
25
|
-
connectedApps = []
|
26
|
-
|
27
23
|
/**
|
28
24
|
* @param {Object} config
|
29
25
|
*/
|
30
26
|
construct(config) {
|
31
27
|
super.construct(config);
|
32
28
|
|
33
|
-
let
|
34
|
-
search, searchString;
|
29
|
+
let {windowId} = this;
|
35
30
|
|
36
31
|
Neo.Main.getByPath({
|
37
|
-
path
|
38
|
-
windowId
|
32
|
+
path: 'location.search',
|
33
|
+
windowId
|
39
34
|
}).then(data => {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
me.getModel().setData({
|
44
|
-
deck: search.deck || 'learnneo'
|
35
|
+
this.getModel().setData({
|
36
|
+
deck: getSearchParams(data).deck || 'learnneo'
|
45
37
|
})
|
46
38
|
})
|
47
39
|
}
|
48
40
|
|
49
|
-
/**
|
50
|
-
* @param {String} searchString
|
51
|
-
* @returns {Object}
|
52
|
-
*/
|
53
|
-
decodeUri(searchString) {
|
54
|
-
return searchString ? JSON.parse(`{"${decodeURI(searchString.replace(/&/g, "\",\"").replace(/=/g, "\":\""))}"}`) : {}
|
55
|
-
}
|
56
|
-
|
57
41
|
/**
|
58
42
|
* @param {String} learnItem
|
59
43
|
*/
|
@@ -64,65 +48,6 @@ class MainContainerController extends Controller {
|
|
64
48
|
})
|
65
49
|
}
|
66
50
|
|
67
|
-
/**
|
68
|
-
* @param {Object} data
|
69
|
-
* @param {String} data.appName
|
70
|
-
* @param {Number} data.windowId
|
71
|
-
*/
|
72
|
-
async onAppConnect(data) {
|
73
|
-
let me = this,
|
74
|
-
app = Neo.apps[data.appName],
|
75
|
-
mainView = app.mainView,
|
76
|
-
{windowId} = data,
|
77
|
-
searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
|
78
|
-
livePreviewId = me.decodeUri(searchString.substring(1)).id,
|
79
|
-
livePreview = Neo.getComponent(livePreviewId),
|
80
|
-
sourceContainer = livePreview.getReference('preview'),
|
81
|
-
tabContainer = livePreview.tabContainer,
|
82
|
-
sourceView = sourceContainer.removeAt(0, false);
|
83
|
-
|
84
|
-
livePreview.previewContainer = mainView;
|
85
|
-
mainView.add(sourceView);
|
86
|
-
|
87
|
-
tabContainer.activeIndex = 0; // switch to the source view
|
88
|
-
|
89
|
-
tabContainer.getTabAtIndex(1).disabled = true
|
90
|
-
}
|
91
|
-
|
92
|
-
/**
|
93
|
-
* @param {Object} data
|
94
|
-
* @param {String} data.appName
|
95
|
-
* @param {Number} data.windowId
|
96
|
-
*/
|
97
|
-
async onAppDisconnect(data) {
|
98
|
-
let me = this,
|
99
|
-
{appName, windowId} = data,
|
100
|
-
app = Neo.apps[appName],
|
101
|
-
mainView = app.mainView;
|
102
|
-
|
103
|
-
// Closing a code preview window needs to drop the preview back into the related main app
|
104
|
-
if (appName !== 'Portal') {
|
105
|
-
let searchString = await Neo.Main.getByPath({path: 'location.search', windowId}),
|
106
|
-
livePreviewId = me.decodeUri(searchString.substring(1)).id,
|
107
|
-
livePreview = Neo.getComponent(livePreviewId),
|
108
|
-
sourceContainer = livePreview.getReference('preview'),
|
109
|
-
tabContainer = livePreview.tabContainer,
|
110
|
-
sourceView = mainView.removeAt(0, false);
|
111
|
-
|
112
|
-
livePreview.previewContainer = null;
|
113
|
-
sourceContainer.add(sourceView);
|
114
|
-
|
115
|
-
tabContainer.activeIndex = 1; // switch to the source view
|
116
|
-
|
117
|
-
livePreview.getReference('popout-window-button').disabled = false;
|
118
|
-
tabContainer.getTabAtIndex(1).disabled = false
|
119
|
-
}
|
120
|
-
// Close popup windows when closing or reloading the main window
|
121
|
-
else {
|
122
|
-
Neo.Main.windowClose({names: me.connectedApps, windowId})
|
123
|
-
}
|
124
|
-
}
|
125
|
-
|
126
51
|
/**
|
127
52
|
*
|
128
53
|
*/
|
@@ -131,16 +56,11 @@ class MainContainerController extends Controller {
|
|
131
56
|
|
132
57
|
let me = this;
|
133
58
|
|
134
|
-
Neo.currentWorker.on({
|
135
|
-
connect : me.onAppConnect,
|
136
|
-
disconnect: me.onAppDisconnect,
|
137
|
-
scope : me
|
138
|
-
});
|
139
|
-
|
140
59
|
Neo.Main.getByPath({path: 'location.search'})
|
141
60
|
.then(data => {
|
142
|
-
|
143
|
-
|
61
|
+
me.getModel().setData({
|
62
|
+
deck: getSearchParams(data).deck || 'learnneo'
|
63
|
+
});
|
144
64
|
});
|
145
65
|
|
146
66
|
// todo: target file does not exist inside the repo
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import ArticlePreviews
|
2
|
-
import Helix
|
3
|
-
import
|
1
|
+
import ArticlePreviews from '../../store/ArticlePreviews.mjs'
|
2
|
+
import Helix from './Helix.mjs'
|
3
|
+
import Viewport from '../../../../examples/component/helix/Viewport.mjs';
|
4
4
|
|
5
5
|
/**
|
6
6
|
* @class RealWorld2.view.article.HelixContainer
|
7
|
-
* @extends Neo.examples.component.helix.
|
7
|
+
* @extends Neo.examples.component.helix.Viewport
|
8
8
|
*/
|
9
|
-
class HelixContainer extends
|
9
|
+
class HelixContainer extends Viewport {
|
10
10
|
static config = {
|
11
11
|
/**
|
12
12
|
* @member {String} className='RealWorld2.view.article.HelixContainer'
|
@@ -42,6 +42,11 @@ class MainContainer extends Viewport {
|
|
42
42
|
* @member {Neo.collection.Base|null} store_=null
|
43
43
|
*/
|
44
44
|
store_: null,
|
45
|
+
/**
|
46
|
+
* Important for the Portal App, until the new theme fully supports it
|
47
|
+
* @member {String} theme='neo-theme-light'
|
48
|
+
*/
|
49
|
+
theme: 'neo-theme-light',
|
45
50
|
/**
|
46
51
|
* @member {Array} items=[//...]
|
47
52
|
*/
|
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
|
|
20
20
|
*/
|
21
21
|
singleton: true,
|
22
22
|
/**
|
23
|
-
* @member {String} version='6.
|
23
|
+
* @member {String} version='6.18.0'
|
24
24
|
*/
|
25
|
-
version: '6.
|
25
|
+
version: '6.18.0'
|
26
26
|
}
|
27
27
|
|
28
28
|
/**
|
@@ -32,6 +32,4 @@ class ServiceWorker extends ServiceBase {
|
|
32
32
|
workerId = 'service'
|
33
33
|
}
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
export default instance;
|
35
|
+
export default Neo.setupClass(ServiceWorker);
|