neo.mjs 6.17.2 → 6.18.1
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 +1 -1
- package/apps/portal/view/ViewportController.mjs +89 -1
- package/apps/portal/view/home/MainContainer.mjs +34 -6
- package/apps/portal/view/home/parts/AfterMath.mjs +1 -1
- package/apps/portal/view/home/parts/Colors.mjs +98 -0
- package/apps/portal/view/home/parts/Helix.mjs +114 -0
- package/apps/portal/view/home/parts/HelloWorld.mjs +6 -3
- package/apps/portal/view/home/parts/How.mjs +66 -0
- package/apps/portal/view/home/parts/MainNeo.mjs +4 -3
- package/apps/portal/view/learn/LivePreview.mjs +56 -15
- 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/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 +2 -2
- package/resources/data/deck/learnneo/pages/Events.md +15 -9
- package/resources/data/deck/learnneo/pages/GuideEvents.md +254 -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_text_primary.svg +5 -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 +142 -124
- package/resources/scss/src/apps/portal/home/MainContainer.scss +9 -22
- package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +22 -0
- package/resources/scss/src/apps/portal/home/preview/PageCodeContainer.scss +1 -1
- 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 +73 -41
- 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/container/Accordion.mjs +18 -20
- package/src/container/AccordionItem.mjs +12 -11
- package/src/container/Base.mjs +24 -23
- package/src/container/Panel.mjs +9 -9
- 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 +40 -24
- 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/IntersectionObserver.mjs +20 -1
- 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 +41 -44
- 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 +16 -14
- 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 +1 -1
- 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/apps/portal/view/home/parts/CoolStuff.mjs +0 -82
- package/examples/component/helix/MainContainer.mjs +0 -340
- /package/resources/images/{Neo_Logo_Blue.svg → logo/neo_logo_secondary.svg} +0 -0
- /package/resources/images/{Neo_Logo_Text.svg → logo/neo_logo_text_secondary.svg} +0 -0
- /package/resources/images/{Neo_Logo_White.svg → logo/neo_logo_white.svg} +0 -0
@@ -0,0 +1,114 @@
|
|
1
|
+
import Container from '../../../../../src/container/Base.mjs';
|
2
|
+
import LivePreview from '../../learn/LivePreview.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Portal.view.home.parts.Helix
|
6
|
+
* @extends Neo.container.Base
|
7
|
+
*/
|
8
|
+
class Helix extends Container {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Portal.view.home.parts.Helix'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Portal.view.home.parts.Helix',
|
15
|
+
/**
|
16
|
+
* @member {String[]} cls=['page','cool-stuff']
|
17
|
+
*/
|
18
|
+
cls: ['page', 'cool-stuff'],
|
19
|
+
/**
|
20
|
+
* @member {Object} responsive
|
21
|
+
*/
|
22
|
+
responsive: {
|
23
|
+
medium: {layout: {ntype: 'vbox', align: 'stretch', pack: 'center'}},
|
24
|
+
large : {layout: {ntype: 'hbox', align: 'stretch', pack: 'center'}}
|
25
|
+
},
|
26
|
+
/**
|
27
|
+
* @member {Object[]} items
|
28
|
+
*/
|
29
|
+
items: [{
|
30
|
+
module: Container,
|
31
|
+
flex : '1',
|
32
|
+
style : {padding: '2rem'},
|
33
|
+
layout: {ntype: 'vbox', align: 'center', pack: 'center'},
|
34
|
+
items : [{
|
35
|
+
cls : 'neo-h1',
|
36
|
+
flex: 'none',
|
37
|
+
html: 'Extreme Speed',
|
38
|
+
vdom: {tag: 'h1'}
|
39
|
+
}, {
|
40
|
+
cls : 'neo-h2',
|
41
|
+
flex: 'none',
|
42
|
+
html: '40,000 Updates /s',
|
43
|
+
vdom: {tag: 'h2'}
|
44
|
+
}, {
|
45
|
+
cls : 'neo-h3',
|
46
|
+
flex: 'none',
|
47
|
+
vdom: {tag: 'p'},
|
48
|
+
|
49
|
+
html: [
|
50
|
+
'This demo shows the Neo.mjs helix component, along with a "Helix Controls" panel. ',
|
51
|
+
'Move your cursor over the helix, then rapidly scroll left and right to rotate, and up and down to zoom. ',
|
52
|
+
'As you do, look at the delta updates counter at the top. ',
|
53
|
+
'Neo.mjs easily handles 40,000 updates per second, and beyond.'
|
54
|
+
].join('')
|
55
|
+
}, {
|
56
|
+
cls : 'neo-h1',
|
57
|
+
flex: 'none',
|
58
|
+
html: 'Multi-Window',
|
59
|
+
vdom: {tag: 'h1'}
|
60
|
+
}, {
|
61
|
+
cls : 'neo-h2',
|
62
|
+
flex: 'none',
|
63
|
+
html: 'Seamless and Simple',
|
64
|
+
vdom: {tag: 'h2'}
|
65
|
+
}, {
|
66
|
+
cls : 'neo-h3',
|
67
|
+
flex: 'none',
|
68
|
+
vdom: {tag: 'p'},
|
69
|
+
|
70
|
+
html: [
|
71
|
+
'Click on the small window icon in the Helix Controls title bar and the controls open in their own window ',
|
72
|
+
'which can be moved to a separate monitor. But the application logic doesn\'t care — ',
|
73
|
+
'the logic updates the controls just like before, and framework seamlessly handles updating the DOM across windows.'
|
74
|
+
].join('')
|
75
|
+
}]
|
76
|
+
}, {
|
77
|
+
module: Container,
|
78
|
+
flex : '2',
|
79
|
+
style : {background: 'lightgray', padding: '20px'},
|
80
|
+
layout: {ntype: 'vbox', align: 'stretch', pack: 'center'},
|
81
|
+
items : [{
|
82
|
+
module : LivePreview,
|
83
|
+
cls : ['page-live-preview'],
|
84
|
+
height : '100%',
|
85
|
+
reference: 'live-preview',
|
86
|
+
|
87
|
+
value: [
|
88
|
+
"import Viewport from '../../../../examples/component/multiWindowHelix/Viewport.mjs';",
|
89
|
+
"",
|
90
|
+
"class MainView extends Viewport {",
|
91
|
+
" static config = {",
|
92
|
+
" className : 'Portal.view.MultiWindowHelix',",
|
93
|
+
" showGitHubStarButton: false,",
|
94
|
+
" theme : 'neo-theme-dark'",
|
95
|
+
" }",
|
96
|
+
"}",
|
97
|
+
"",
|
98
|
+
"Neo.setupClass(MainView);"
|
99
|
+
].join('\n')
|
100
|
+
}]
|
101
|
+
}]
|
102
|
+
}
|
103
|
+
|
104
|
+
/**
|
105
|
+
*
|
106
|
+
*/
|
107
|
+
activate() {
|
108
|
+
this.getReference('live-preview').activeView = 'preview'
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
Neo.setupClass(Helix);
|
113
|
+
|
114
|
+
export default Helix;
|
@@ -44,15 +44,18 @@ class HelloWorld extends Container {
|
|
44
44
|
cls : 'neo-h1',
|
45
45
|
id : 'neo-hello-world-h1',
|
46
46
|
flex: 'none',
|
47
|
-
html: 'Hello World'
|
47
|
+
html: 'Hello World',
|
48
|
+
vdom: {tag: 'h1'}
|
48
49
|
}, {
|
49
50
|
cls : 'neo-h2',
|
50
51
|
flex: 'none',
|
51
|
-
html: 'Your first code snippet'
|
52
|
+
html: 'Your first code snippet',
|
53
|
+
vdom: {tag: 'h2'}
|
52
54
|
}, {
|
53
55
|
cls : 'neo-content',
|
54
56
|
flex: 'none',
|
55
|
-
html: 'If you understand these lines, you are ready to start with Neo.mjs'
|
57
|
+
html: 'If you understand these lines, you are ready to start with Neo.mjs',
|
58
|
+
vdom: {tag: 'p'}
|
56
59
|
}]
|
57
60
|
}, {
|
58
61
|
module: LivePreviewContainer,
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import Container from '../../../../../src/container/Base.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Portal.view.home.parts.How
|
5
|
+
* @extends Neo.container.Base
|
6
|
+
*/
|
7
|
+
class How extends Container {
|
8
|
+
static config = {
|
9
|
+
className: 'Portal.view.home.parts.How',
|
10
|
+
/**
|
11
|
+
* @member {String[]} cls=['page','cool-stuff']
|
12
|
+
*/
|
13
|
+
cls: ['page', 'cool-stuff'],
|
14
|
+
/**
|
15
|
+
* @member {Object} responsive
|
16
|
+
*/
|
17
|
+
responsive: {
|
18
|
+
medium: {layout: {ntype: 'vbox', align: 'stretch', pack: 'center'}},
|
19
|
+
large : {layout: {ntype: 'hbox', align: 'stretch', pack: 'center'}}
|
20
|
+
},
|
21
|
+
/**
|
22
|
+
* @member {Object[]} items
|
23
|
+
*/
|
24
|
+
items: [{
|
25
|
+
module: Container,
|
26
|
+
flex : '1',
|
27
|
+
style : {padding: '2rem'},
|
28
|
+
layout: {ntype: 'vbox', align: 'center', pack: 'center'},
|
29
|
+
items : [{
|
30
|
+
cls : 'neo-h1',
|
31
|
+
flex: 'none',
|
32
|
+
html: 'How?',
|
33
|
+
vdom: {tag: 'h1'}
|
34
|
+
}, {
|
35
|
+
cls : 'neo-h2',
|
36
|
+
flex: 'none',
|
37
|
+
html: 'How Does Neo.mjs Do It?',
|
38
|
+
vdom: {tag: 'h2'}
|
39
|
+
}, {
|
40
|
+
cls : 'neo-h3',
|
41
|
+
flex: 'none',
|
42
|
+
vdom: {tag: 'p'},
|
43
|
+
html: [
|
44
|
+
'When a Neo.mjs app launches three webworkers are spawned: one that holds app logic, one for tracking delta DOM updates, ',
|
45
|
+
'and one for backend calls. Each webworker runs in its own thread, and thus, in its own processor core. ',
|
46
|
+
'This means these processes run in parallel: your app logic isn\'t affected by DOM changes or ',
|
47
|
+
'by Ajax or socket calls. If you have processor-intensive tasks you can easily run them in their own threads.'
|
48
|
+
].join('')
|
49
|
+
}]
|
50
|
+
}, {
|
51
|
+
module: Container,
|
52
|
+
flex : '2',
|
53
|
+
style : {background: 'lightgray', padding: '20px'},
|
54
|
+
layout: {ntype: 'vbox', align: 'stretch', pack: 'center'},
|
55
|
+
items : [{
|
56
|
+
flex : 'none',
|
57
|
+
style: {width: '100%'},
|
58
|
+
vdom : {tag: 'img', src: 'https://s3.amazonaws.com/mjs.neo.learning.images/why/IndexHtmlFlow.png'}
|
59
|
+
}]
|
60
|
+
}]
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
Neo.setupClass(How);
|
65
|
+
|
66
|
+
export default How;
|
@@ -13,7 +13,7 @@ class MainNeo extends Container {
|
|
13
13
|
*/
|
14
14
|
className: 'Portal.view.home.parts.MainNeo',
|
15
15
|
|
16
|
-
cls: ['page', '
|
16
|
+
cls: ['page', 'portal-home-main-neo'],
|
17
17
|
|
18
18
|
layout: {ntype: 'vbox', align: 'center', pack: 'center'},
|
19
19
|
/**
|
@@ -24,9 +24,10 @@ class MainNeo extends Container {
|
|
24
24
|
cls : ['vector'],
|
25
25
|
flex : 'none',
|
26
26
|
}, {
|
27
|
-
cls : 'neo-h1',
|
27
|
+
cls : ['neo-h1'],
|
28
28
|
flex: 'none',
|
29
|
-
html: 'The High-Performance Web Framework for Next Generation Interfaces'
|
29
|
+
html: 'The High-Performance Web Framework for Next Generation Interfaces',
|
30
|
+
vdom: {tag: 'h1'}
|
30
31
|
}, {
|
31
32
|
module: Container,
|
32
33
|
cls : ['button-group'],
|
@@ -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 = [],
|
@@ -235,6 +272,7 @@ class LivePreview extends Container {
|
|
235
272
|
}
|
236
273
|
|
237
274
|
this.getReference('popout-window-button').hidden = data.value !== 1
|
275
|
+
this.disableRunSource = false;
|
238
276
|
}
|
239
277
|
|
240
278
|
/**
|
@@ -243,8 +281,8 @@ class LivePreview extends Container {
|
|
243
281
|
onConstructed() {
|
244
282
|
super.onConstructed();
|
245
283
|
|
246
|
-
let me
|
247
|
-
tabContainer = me
|
284
|
+
let me = this,
|
285
|
+
{tabContainer} = me;
|
248
286
|
|
249
287
|
// we want to add a normal (non-header) button
|
250
288
|
tabContainer.getTabBar().add({
|
@@ -256,7 +294,10 @@ class LivePreview extends Container {
|
|
256
294
|
ui : 'ghost'
|
257
295
|
});
|
258
296
|
|
259
|
-
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()
|
260
301
|
}
|
261
302
|
|
262
303
|
/**
|
@@ -269,7 +310,7 @@ class LivePreview extends Container {
|
|
269
310
|
await me.createPopupWindow();
|
270
311
|
|
271
312
|
// this component requires a view controller to manage connected apps
|
272
|
-
me.getController()?.connectedApps.push(me.id)
|
313
|
+
me.getController('viewport-controller')?.connectedApps.push(me.id)
|
273
314
|
}
|
274
315
|
}
|
275
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.1'
|
24
24
|
*/
|
25
|
-
version: '6.
|
25
|
+
version: '6.18.1'
|
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);
|