@difizen/libro-common 0.3.3 → 1.0.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/es/app/app.d.ts +7 -0
- package/es/app/app.d.ts.map +1 -0
- package/es/app/app.js +51 -0
- package/es/app/file-tree/file-selection.d.ts +15 -0
- package/es/app/file-tree/file-selection.d.ts.map +1 -0
- package/es/app/file-tree/file-selection.js +38 -0
- package/es/app/file-tree/file-service.d.ts +19 -0
- package/es/app/file-tree/file-service.d.ts.map +1 -0
- package/es/app/file-tree/file-service.js +105 -0
- package/es/app/file-tree/file-tree-component.d.ts +6 -0
- package/es/app/file-tree/file-tree-component.d.ts.map +1 -0
- package/es/app/file-tree/file-tree-component.js +14 -0
- package/es/app/file-tree/file-tree-icon.d.ts +3 -0
- package/es/app/file-tree/file-tree-icon.d.ts.map +1 -0
- package/es/app/file-tree/file-tree-icon.js +14 -0
- package/es/app/file-tree/file-tree-label-provider.d.ts +18 -0
- package/es/app/file-tree/file-tree-label-provider.d.ts.map +1 -0
- package/es/app/file-tree/file-tree-label-provider.js +54 -0
- package/es/app/file-tree/file-tree-model.d.ts +40 -0
- package/es/app/file-tree/file-tree-model.d.ts.map +1 -0
- package/es/app/file-tree/file-tree-model.js +358 -0
- package/es/app/file-tree/file-tree-protocol.d.ts +12 -0
- package/es/app/file-tree/file-tree-protocol.d.ts.map +1 -0
- package/es/app/file-tree/file-tree-protocol.js +33 -0
- package/es/app/file-tree/file-tree-view.d.ts +51 -0
- package/es/app/file-tree/file-tree-view.d.ts.map +1 -0
- package/es/app/file-tree/file-tree-view.js +420 -0
- package/es/app/file-tree/file-tree.d.ts +48 -0
- package/es/app/file-tree/file-tree.d.ts.map +1 -0
- package/es/app/file-tree/file-tree.js +279 -0
- package/es/app/file-tree/files.d.ts +575 -0
- package/es/app/file-tree/files.d.ts.map +1 -0
- package/es/app/file-tree/files.js +478 -0
- package/es/app/file-tree/filesystem-utils.d.ts +14 -0
- package/es/app/file-tree/filesystem-utils.d.ts.map +1 -0
- package/es/app/file-tree/filesystem-utils.js +20 -0
- package/es/app/file-tree/index.d.ts +7 -0
- package/es/app/file-tree/index.d.ts.map +1 -0
- package/es/app/file-tree/index.js +6 -0
- package/es/app/file-tree/module.d.ts +3 -0
- package/es/app/file-tree/module.d.ts.map +1 -0
- package/es/app/file-tree/module.js +18 -0
- package/es/app/file-tree/selection-command-handler.d.ts +25 -0
- package/es/app/file-tree/selection-command-handler.d.ts.map +1 -0
- package/es/app/file-tree/selection-command-handler.js +124 -0
- package/es/app/file-tree/style/file-icon.less +51 -0
- package/es/app/index.d.ts +15 -0
- package/es/app/index.d.ts.map +1 -0
- package/es/app/index.js +22 -0
- package/es/app/label/index.d.ts +4 -0
- package/es/app/label/index.d.ts.map +1 -0
- package/es/app/label/index.js +4 -0
- package/es/app/label/label-provider.d.ts +169 -0
- package/es/app/label/label-provider.d.ts.map +1 -0
- package/es/app/label/label-provider.js +488 -0
- package/es/app/menu/index.d.ts +8 -0
- package/es/app/menu/index.d.ts.map +1 -0
- package/es/app/menu/index.js +21 -0
- package/es/app/menu/menu-bar-render.d.ts +11 -0
- package/es/app/menu/menu-bar-render.d.ts.map +1 -0
- package/es/app/menu/menu-bar-render.js +46 -0
- package/es/app/menu/menu-color-registry.d.ts +6 -0
- package/es/app/menu/menu-color-registry.d.ts.map +1 -0
- package/es/app/menu/menu-color-registry.js +59 -0
- package/es/app/menu/menu-context.d.ts +13 -0
- package/es/app/menu/menu-context.d.ts.map +1 -0
- package/es/app/menu/menu-context.js +7 -0
- package/es/app/menu/menu-item-keeper.d.ts +12 -0
- package/es/app/menu/menu-item-keeper.d.ts.map +1 -0
- package/es/app/menu/menu-item-keeper.js +68 -0
- package/es/app/menu/menu-item-render.d.ts +4 -0
- package/es/app/menu/menu-item-render.d.ts.map +1 -0
- package/es/app/menu/menu-item-render.js +13 -0
- package/es/app/menu/menu-protocol.d.ts +18 -0
- package/es/app/menu/menu-protocol.d.ts.map +1 -0
- package/es/app/menu/menu-protocol.js +5 -0
- package/es/app/menu/menu-render.d.ts +30 -0
- package/es/app/menu/menu-render.d.ts.map +1 -0
- package/es/app/menu/menu-render.js +85 -0
- package/es/app/menu/menu.d.ts +47 -0
- package/es/app/menu/menu.d.ts.map +1 -0
- package/es/app/menu/menu.js +234 -0
- package/es/app/modal/index.d.ts +9 -0
- package/es/app/modal/index.d.ts.map +1 -0
- package/es/app/modal/index.js +19 -0
- package/es/app/modal/modal-contribution.d.ts +7 -0
- package/es/app/modal/modal-contribution.d.ts.map +1 -0
- package/es/app/modal/modal-contribution.js +34 -0
- package/es/app/modal/modal-protocol.d.ts +22 -0
- package/es/app/modal/modal-protocol.d.ts.map +1 -0
- package/es/app/modal/modal-protocol.js +13 -0
- package/es/app/modal/modal-render.d.ts +6 -0
- package/es/app/modal/modal-render.d.ts.map +1 -0
- package/es/app/modal/modal-render.js +44 -0
- package/es/app/modal/modal-service.d.ts +41 -0
- package/es/app/modal/modal-service.d.ts.map +1 -0
- package/es/app/modal/modal-service.js +200 -0
- package/es/app/notification/index.d.ts +5 -0
- package/es/app/notification/index.d.ts.map +1 -0
- package/es/app/notification/index.js +5 -0
- package/es/app/notification/index.less +20 -0
- package/es/app/notification/protocol.d.ts +15 -0
- package/es/app/notification/protocol.d.ts.map +1 -0
- package/es/app/notification/protocol.js +1 -0
- package/es/app/notification/service.d.ts +11 -0
- package/es/app/notification/service.d.ts.map +1 -0
- package/es/app/notification/service.js +87 -0
- package/es/app/style/index.less +181 -0
- package/es/app/style/style-protocol.d.ts +10 -0
- package/es/app/style/style-protocol.d.ts.map +1 -0
- package/es/app/style/style-protocol.js +11 -0
- package/es/app/toolbar/index.d.ts +7 -0
- package/es/app/toolbar/index.d.ts.map +1 -0
- package/es/app/toolbar/index.js +15 -0
- package/es/app/toolbar/index.less +40 -0
- package/es/app/toolbar/toolbar-item-keeper.d.ts +12 -0
- package/es/app/toolbar/toolbar-item-keeper.d.ts.map +1 -0
- package/es/app/toolbar/toolbar-item-keeper.js +49 -0
- package/es/app/toolbar/toolbar-item-render.d.ts +13 -0
- package/es/app/toolbar/toolbar-item-render.d.ts.map +1 -0
- package/es/app/toolbar/toolbar-item-render.js +14 -0
- package/es/app/toolbar/toolbar-protocol.d.ts +9 -0
- package/es/app/toolbar/toolbar-protocol.d.ts.map +1 -0
- package/es/app/toolbar/toolbar-protocol.js +1 -0
- package/es/app/toolbar/toolbar-render.d.ts +29 -0
- package/es/app/toolbar/toolbar-render.d.ts.map +1 -0
- package/es/app/toolbar/toolbar-render.js +93 -0
- package/es/app/toolbar/toolbar-visible-render.d.ts +8 -0
- package/es/app/toolbar/toolbar-visible-render.d.ts.map +1 -0
- package/es/app/toolbar/toolbar-visible-render.js +12 -0
- package/es/app/toolbar/toolbar.d.ts +51 -0
- package/es/app/toolbar/toolbar.d.ts.map +1 -0
- package/es/app/toolbar/toolbar.js +275 -0
- package/es/app/tree/components/index.d.ts +3 -0
- package/es/app/tree/components/index.d.ts.map +1 -0
- package/es/app/tree/components/index.js +20 -0
- package/es/app/tree/components/tree-ident.d.ts +4 -0
- package/es/app/tree/components/tree-ident.d.ts.map +1 -0
- package/es/app/tree/components/tree-ident.js +40 -0
- package/es/app/tree/components/tree-node-caption-affix.d.ts +4 -0
- package/es/app/tree/components/tree-node-caption-affix.d.ts.map +1 -0
- package/es/app/tree/components/tree-node-caption-affix.js +39 -0
- package/es/app/tree/components/tree-node-caption.d.ts +3 -0
- package/es/app/tree/components/tree-node-caption.d.ts.map +1 -0
- package/es/app/tree/components/tree-node-caption.js +103 -0
- package/es/app/tree/components/tree-node-expansion.d.ts +3 -0
- package/es/app/tree/components/tree-node-expansion.d.ts.map +1 -0
- package/es/app/tree/components/tree-node-expansion.js +36 -0
- package/es/app/tree/components/tree-node-icon-decorator.d.ts +4 -0
- package/es/app/tree/components/tree-node-icon-decorator.d.ts.map +1 -0
- package/es/app/tree/components/tree-node-icon-decorator.js +46 -0
- package/es/app/tree/components/tree-node-icon.d.ts +2 -0
- package/es/app/tree/components/tree-node-icon.d.ts.map +1 -0
- package/es/app/tree/components/tree-node-icon.js +3 -0
- package/es/app/tree/components/tree-node-tail-decoration.d.ts +3 -0
- package/es/app/tree/components/tree-node-tail-decoration.d.ts.map +1 -0
- package/es/app/tree/components/tree-node-tail-decoration.js +39 -0
- package/es/app/tree/components/tree-node.d.ts +4 -0
- package/es/app/tree/components/tree-node.d.ts.map +1 -0
- package/es/app/tree/components/tree-node.js +40 -0
- package/es/app/tree/components/tree-switch-icon.d.ts +4 -0
- package/es/app/tree/components/tree-switch-icon.d.ts.map +1 -0
- package/es/app/tree/components/tree-switch-icon.js +14 -0
- package/es/app/tree/index.d.ts +16 -0
- package/es/app/tree/index.d.ts.map +1 -0
- package/es/app/tree/index.js +15 -0
- package/es/app/tree/module.d.ts +5 -0
- package/es/app/tree/module.d.ts.map +1 -0
- package/es/app/tree/module.js +19 -0
- package/es/app/tree/style/index.less +206 -0
- package/es/app/tree/style/tree-decorator.less +65 -0
- package/es/app/tree/tree-decorator.d.ts +141 -0
- package/es/app/tree/tree-decorator.d.ts.map +1 -0
- package/es/app/tree/tree-decorator.js +248 -0
- package/es/app/tree/tree-expansion.d.ts +69 -0
- package/es/app/tree/tree-expansion.d.ts.map +1 -0
- package/es/app/tree/tree-expansion.js +250 -0
- package/es/app/tree/tree-impl.d.ts +40 -0
- package/es/app/tree/tree-impl.d.ts.map +1 -0
- package/es/app/tree/tree-impl.js +292 -0
- package/es/app/tree/tree-iterator.d.ts +94 -0
- package/es/app/tree/tree-iterator.d.ts.map +1 -0
- package/es/app/tree/tree-iterator.js +368 -0
- package/es/app/tree/tree-label-provider.d.ts +9 -0
- package/es/app/tree/tree-label-provider.d.ts.map +1 -0
- package/es/app/tree/tree-label-provider.js +39 -0
- package/es/app/tree/tree-model.d.ts +163 -0
- package/es/app/tree/tree-model.d.ts.map +1 -0
- package/es/app/tree/tree-model.js +616 -0
- package/es/app/tree/tree-navigation.d.ts +11 -0
- package/es/app/tree/tree-navigation.d.ts.map +1 -0
- package/es/app/tree/tree-navigation.js +54 -0
- package/es/app/tree/tree-protocol.d.ts +67 -0
- package/es/app/tree/tree-protocol.d.ts.map +1 -0
- package/es/app/tree/tree-protocol.js +24 -0
- package/es/app/tree/tree-selection-impl.d.ts +45 -0
- package/es/app/tree/tree-selection-impl.d.ts.map +1 -0
- package/es/app/tree/tree-selection-impl.js +192 -0
- package/es/app/tree/tree-selection-state.d.ts +48 -0
- package/es/app/tree/tree-selection-state.d.ts.map +1 -0
- package/es/app/tree/tree-selection-state.js +276 -0
- package/es/app/tree/tree-selection.d.ts +79 -0
- package/es/app/tree/tree-selection.d.ts.map +1 -0
- package/es/app/tree/tree-selection.js +72 -0
- package/es/app/tree/tree-view-decoration.d.ts +286 -0
- package/es/app/tree/tree-view-decoration.d.ts.map +1 -0
- package/es/app/tree/tree-view-decoration.js +127 -0
- package/es/app/tree/tree.d.ts +166 -0
- package/es/app/tree/tree.d.ts.map +1 -0
- package/es/app/tree/tree.js +155 -0
- package/es/app/tree/view/index.d.ts +4 -0
- package/es/app/tree/view/index.d.ts.map +1 -0
- package/es/app/tree/view/index.js +3 -0
- package/es/app/tree/view/index.less +3 -0
- package/es/app/tree/view/tree-view-decorator.d.ts +38 -0
- package/es/app/tree/view/tree-view-decorator.d.ts.map +1 -0
- package/es/app/tree/view/tree-view-decorator.js +128 -0
- package/es/app/tree/view/tree-view-module.d.ts +3 -0
- package/es/app/tree/view/tree-view-module.d.ts.map +1 -0
- package/es/app/tree/view/tree-view-module.js +8 -0
- package/es/app/tree/view/tree-view-selection.d.ts +12 -0
- package/es/app/tree/view/tree-view-selection.d.ts.map +1 -0
- package/es/app/tree/view/tree-view-selection.js +23 -0
- package/es/app/tree/view/tree-view.d.ts +262 -0
- package/es/app/tree/view/tree-view.d.ts.map +1 -0
- package/es/app/tree/view/tree-view.js +943 -0
- package/es/app/typings/index.d.ts +7 -0
- package/es/app/view/box/index.d.ts +19 -0
- package/es/app/view/box/index.d.ts.map +1 -0
- package/es/app/view/box/index.js +76 -0
- package/es/app/view/components/index.d.ts +2 -0
- package/es/app/view/components/index.d.ts.map +1 -0
- package/es/app/view/components/index.js +1 -0
- package/es/app/view/components/loading/index.d.ts +3 -0
- package/es/app/view/components/loading/index.d.ts.map +1 -0
- package/es/app/view/components/loading/index.js +7 -0
- package/es/app/view/components/loading/index.less +10 -0
- package/es/app/view/flex/index.d.ts +16 -0
- package/es/app/view/flex/index.d.ts.map +1 -0
- package/es/app/view/flex/index.js +67 -0
- package/es/app/view/flex/index.less +3 -0
- package/es/app/view/header/header-view.d.ts +12 -0
- package/es/app/view/header/header-view.d.ts.map +1 -0
- package/es/app/view/header/header-view.js +68 -0
- package/es/app/view/header/index.d.ts +4 -0
- package/es/app/view/header/index.d.ts.map +1 -0
- package/es/app/view/header/index.js +23 -0
- package/es/app/view/header/index.less +43 -0
- package/es/app/view/index.d.ts +8 -0
- package/es/app/view/index.d.ts.map +1 -0
- package/es/app/view/index.js +11 -0
- package/es/app/view/tab/card-tab-view.d.ts +13 -0
- package/es/app/view/tab/card-tab-view.d.ts.map +1 -0
- package/es/app/view/tab/card-tab-view.js +49 -0
- package/es/app/view/tab/index.d.ts +4 -0
- package/es/app/view/tab/index.d.ts.map +1 -0
- package/es/app/view/tab/index.js +3 -0
- package/es/app/view/tab/index.less +70 -0
- package/es/app/view/tab/side-tab-view.d.ts +23 -0
- package/es/app/view/tab/side-tab-view.d.ts.map +1 -0
- package/es/app/view/tab/side-tab-view.js +121 -0
- package/es/app/view/tab/tab-menu.d.ts +9 -0
- package/es/app/view/tab/tab-menu.d.ts.map +1 -0
- package/es/app/view/tab/tab-menu.js +34 -0
- package/es/app/view/tab/tab-protocol.d.ts +3 -0
- package/es/app/view/tab/tab-protocol.d.ts.map +1 -0
- package/es/app/view/tab/tab-protocol.js +1 -0
- package/es/app/view/tab/tab-view.d.ts +27 -0
- package/es/app/view/tab/tab-view.d.ts.map +1 -0
- package/es/app/view/tab/tab-view.js +169 -0
- package/es/common/assert.d.ts +5 -0
- package/es/common/assert.d.ts.map +1 -0
- package/es/common/assert.js +13 -0
- package/es/common/cancellation.d.ts +20 -0
- package/es/common/cancellation.d.ts.map +1 -0
- package/es/common/cancellation.js +143 -0
- package/es/common/charCode.d.ts +416 -0
- package/es/common/charCode.d.ts.map +1 -0
- package/es/common/charCode.js +604 -0
- package/es/common/collections.d.ts +44 -0
- package/es/common/collections.d.ts.map +1 -0
- package/es/common/collections.js +220 -0
- package/es/common/deferred.d.ts +10 -0
- package/es/common/deferred.d.ts.map +1 -0
- package/es/common/deferred.js +21 -0
- package/es/common/disposable-collection.d.ts +24 -0
- package/es/common/disposable-collection.d.ts.map +1 -0
- package/es/common/disposable-collection.js +117 -0
- package/es/common/disposable.d.ts +19 -0
- package/es/common/disposable.d.ts.map +1 -0
- package/es/common/disposable.js +23 -0
- package/es/common/event.d.ts +75 -0
- package/es/common/event.d.ts.map +1 -0
- package/es/common/event.js +313 -0
- package/es/common/index.d.ts +27 -0
- package/es/common/index.d.ts.map +1 -0
- package/es/common/index.js +26 -0
- package/es/common/iterator.d.ts +39 -0
- package/es/common/iterator.d.ts.map +1 -0
- package/es/common/iterator.js +389 -0
- package/es/common/linkedList.d.ts +16 -0
- package/es/common/linkedList.d.ts.map +1 -0
- package/es/common/linkedList.js +159 -0
- package/es/common/objects.d.ts +36 -0
- package/es/common/objects.d.ts.map +1 -0
- package/es/common/objects.js +232 -0
- package/es/common/observable-disposable.d.ts +12 -0
- package/es/common/observable-disposable.d.ts.map +1 -0
- package/es/common/observable-disposable.js +1 -0
- package/es/common/path.d.ts +59 -0
- package/es/common/path.d.ts.map +1 -0
- package/es/common/path.js +258 -0
- package/es/common/platform.d.ts +72 -0
- package/es/common/platform.d.ts.map +1 -0
- package/es/common/platform.js +213 -0
- package/es/common/priority.d.ts +23 -0
- package/es/common/priority.d.ts.map +1 -0
- package/es/common/priority.js +97 -0
- package/es/common/promise-util.d.ts +8 -0
- package/es/common/promise-util.d.ts.map +1 -0
- package/es/common/promise-util.js +63 -0
- package/es/common/stopwatch.d.ts +11 -0
- package/es/common/stopwatch.d.ts.map +1 -0
- package/es/common/stopwatch.js +47 -0
- package/es/common/strings.d.ts +102 -0
- package/es/common/strings.d.ts.map +1 -0
- package/es/common/strings.js +433 -0
- package/es/common/types.d.ts +16 -0
- package/es/common/types.d.ts.map +1 -0
- package/es/common/types.js +13 -0
- package/es/common/uint.d.ts +32 -0
- package/es/common/uint.d.ts.map +1 -0
- package/es/common/uint.js +56 -0
- package/es/common/uri.d.ts +56 -0
- package/es/common/uri.d.ts.map +1 -0
- package/es/common/uri.js +244 -0
- package/es/common/utils.d.ts +4 -0
- package/es/common/utils.d.ts.map +1 -0
- package/es/common/utils.js +26 -0
- package/es/common/valueTypes.d.ts +102 -0
- package/es/common/valueTypes.d.ts.map +1 -0
- package/es/common/valueTypes.js +270 -0
- package/es/common/vscode-uri/char-code.d.ts +416 -0
- package/es/common/vscode-uri/char-code.d.ts.map +1 -0
- package/es/common/vscode-uri/char-code.js +608 -0
- package/es/common/vscode-uri/index.d.ts +6 -0
- package/es/common/vscode-uri/index.d.ts.map +1 -0
- package/es/common/vscode-uri/index.js +8 -0
- package/es/common/vscode-uri/platform.d.ts +2 -0
- package/es/common/vscode-uri/platform.d.ts.map +1 -0
- package/es/common/vscode-uri/platform.js +17 -0
- package/es/common/vscode-uri/uri.d.ts +155 -0
- package/es/common/vscode-uri/uri.d.ts.map +1 -0
- package/es/common/vscode-uri/uri.js +637 -0
- package/es/common/vscode-uri/utils.d.ts +59 -0
- package/es/common/vscode-uri/utils.d.ts.map +1 -0
- package/es/common/vscode-uri/utils.js +61 -0
- package/es/common/wait-until-event.d.ts +17 -0
- package/es/common/wait-until-event.d.ts.map +1 -0
- package/es/common/wait-until-event.js +65 -0
- package/es/core/application/application-protocol.d.ts +19 -0
- package/es/core/application/application-protocol.d.ts.map +1 -0
- package/es/core/application/application-protocol.js +4 -0
- package/es/core/application/application-state.d.ts +24 -0
- package/es/core/application/application-state.d.ts.map +1 -0
- package/es/core/application/application-state.js +87 -0
- package/es/core/application/application.d.ts +86 -0
- package/es/core/application/application.d.ts.map +1 -0
- package/es/core/application/application.js +554 -0
- package/es/core/application/default-window-service.d.ts +27 -0
- package/es/core/application/default-window-service.d.ts.map +1 -0
- package/es/core/application/default-window-service.js +83 -0
- package/es/core/application/index.d.ts +5 -0
- package/es/core/application/index.d.ts.map +1 -0
- package/es/core/application/index.js +7 -0
- package/es/core/application/mock-window-service.d.ts +8 -0
- package/es/core/application/mock-window-service.d.ts.map +1 -0
- package/es/core/application/mock-window-service.js +31 -0
- package/es/core/browser.d.ts +21 -0
- package/es/core/browser.d.ts.map +1 -0
- package/es/core/browser.js +118 -0
- package/es/core/command/command-protocol.d.ts +124 -0
- package/es/core/command/command-protocol.d.ts.map +1 -0
- package/es/core/command/command-protocol.js +44 -0
- package/es/core/command/command-registry.d.ts +144 -0
- package/es/core/command/command-registry.d.ts.map +1 -0
- package/es/core/command/command-registry.js +595 -0
- package/es/core/command/index.d.ts +5 -0
- package/es/core/command/index.d.ts.map +1 -0
- package/es/core/command/index.js +5 -0
- package/es/core/common/debug.d.ts +5 -0
- package/es/core/common/debug.d.ts.map +1 -0
- package/es/core/common/debug.js +3 -0
- package/es/core/common/index.d.ts +6 -0
- package/es/core/common/index.d.ts.map +1 -0
- package/es/core/common/index.js +17 -0
- package/es/core/common/storage-protocol.d.ts +21 -0
- package/es/core/common/storage-protocol.d.ts.map +1 -0
- package/es/core/common/storage-protocol.js +5 -0
- package/es/core/common/storage-service.d.ts +23 -0
- package/es/core/common/storage-service.d.ts.map +1 -0
- package/es/core/common/storage-service.js +91 -0
- package/es/core/components/application.d.ts +16 -0
- package/es/core/components/application.d.ts.map +1 -0
- package/es/core/components/application.js +159 -0
- package/es/core/components/context.d.ts +19 -0
- package/es/core/components/context.d.ts.map +1 -0
- package/es/core/components/context.js +101 -0
- package/es/core/components/hooks.d.ts +4 -0
- package/es/core/components/hooks.d.ts.map +1 -0
- package/es/core/components/hooks.js +14 -0
- package/es/core/components/index.d.ts +7 -0
- package/es/core/components/index.d.ts.map +1 -0
- package/es/core/components/index.js +8 -0
- package/es/core/components/index.less +28 -0
- package/es/core/components/root-view-render.d.ts +5 -0
- package/es/core/components/root-view-render.d.ts.map +1 -0
- package/es/core/components/root-view-render.js +14 -0
- package/es/core/configuration/configuration-cache.d.ts +15 -0
- package/es/core/configuration/configuration-cache.d.ts.map +1 -0
- package/es/core/configuration/configuration-cache.js +67 -0
- package/es/core/configuration/configuration-protocol.d.ts +46 -0
- package/es/core/configuration/configuration-protocol.d.ts.map +1 -0
- package/es/core/configuration/configuration-protocol.js +1 -0
- package/es/core/configuration/configuration-provider.d.ts +46 -0
- package/es/core/configuration/configuration-provider.d.ts.map +1 -0
- package/es/core/configuration/configuration-provider.js +95 -0
- package/es/core/configuration/configuration-registry.d.ts +53 -0
- package/es/core/configuration/configuration-registry.d.ts.map +1 -0
- package/es/core/configuration/configuration-registry.js +360 -0
- package/es/core/configuration/configuration-render-registry.d.ts +35 -0
- package/es/core/configuration/configuration-render-registry.d.ts.map +1 -0
- package/es/core/configuration/configuration-render-registry.js +118 -0
- package/es/core/configuration/configuration-service.d.ts +46 -0
- package/es/core/configuration/configuration-service.d.ts.map +1 -0
- package/es/core/configuration/configuration-service.js +411 -0
- package/es/core/configuration/configuration-storage.d.ts +19 -0
- package/es/core/configuration/configuration-storage.d.ts.map +1 -0
- package/es/core/configuration/configuration-storage.js +15 -0
- package/es/core/configuration/hooks.d.ts +3 -0
- package/es/core/configuration/hooks.d.ts.map +1 -0
- package/es/core/configuration/hooks.js +60 -0
- package/es/core/configuration/index.d.ts +11 -0
- package/es/core/configuration/index.d.ts.map +1 -0
- package/es/core/configuration/index.js +10 -0
- package/es/core/configuration/module.d.ts +3 -0
- package/es/core/configuration/module.d.ts.map +1 -0
- package/es/core/configuration/module.js +8 -0
- package/es/core/configuration/typings.d.ts +1 -0
- package/es/core/configuration/validation.d.ts +12 -0
- package/es/core/configuration/validation.d.ts.map +1 -0
- package/es/core/configuration/validation.js +45 -0
- package/es/core/context/data-context-manager.d.ts +16 -0
- package/es/core/context/data-context-manager.d.ts.map +1 -0
- package/es/core/context/data-context-manager.js +80 -0
- package/es/core/context/data-context-protocol.d.ts +16 -0
- package/es/core/context/data-context-protocol.d.ts.map +1 -0
- package/es/core/context/data-context-protocol.js +10 -0
- package/es/core/context/data-context.d.ts +7 -0
- package/es/core/context/data-context.d.ts.map +1 -0
- package/es/core/context/data-context.js +32 -0
- package/es/core/context/index.d.ts +6 -0
- package/es/core/context/index.d.ts.map +1 -0
- package/es/core/context/index.js +12 -0
- package/es/core/index.d.ts +32 -0
- package/es/core/index.d.ts.map +1 -0
- package/es/core/index.js +42 -0
- package/es/core/keybinding/context-key-service.d.ts +22 -0
- package/es/core/keybinding/context-key-service.d.ts.map +1 -0
- package/es/core/keybinding/context-key-service.js +79 -0
- package/es/core/keybinding/index.d.ts +6 -0
- package/es/core/keybinding/index.d.ts.map +1 -0
- package/es/core/keybinding/index.js +5 -0
- package/es/core/keybinding/keybinding-proocol.d.ts +14 -0
- package/es/core/keybinding/keybinding-proocol.d.ts.map +1 -0
- package/es/core/keybinding/keybinding-proocol.js +5 -0
- package/es/core/keybinding/keybinding.d.ts +333 -0
- package/es/core/keybinding/keybinding.d.ts.map +1 -0
- package/es/core/keybinding/keybinding.js +912 -0
- package/es/core/keybinding/module.d.ts +3 -0
- package/es/core/keybinding/module.d.ts.map +1 -0
- package/es/core/keybinding/module.js +12 -0
- package/es/core/keybinding/vs/configuration/configuration.d.ts +129 -0
- package/es/core/keybinding/vs/configuration/configuration.d.ts.map +1 -0
- package/es/core/keybinding/vs/configuration/configuration.js +328 -0
- package/es/core/keybinding/vs/configuration/configurationModels.d.ts +138 -0
- package/es/core/keybinding/vs/configuration/configurationModels.d.ts.map +1 -0
- package/es/core/keybinding/vs/configuration/configurationModels.js +974 -0
- package/es/core/keybinding/vs/configuration/configurationRegistry.d.ts +145 -0
- package/es/core/keybinding/vs/configuration/configurationRegistry.d.ts.map +1 -0
- package/es/core/keybinding/vs/configuration/configurationRegistry.js +500 -0
- package/es/core/keybinding/vs/configuration/configurationService.d.ts +36 -0
- package/es/core/keybinding/vs/configuration/configurationService.d.ts.map +1 -0
- package/es/core/keybinding/vs/configuration/configurationService.js +161 -0
- package/es/core/keybinding/vs/configuration/json.d.ts +216 -0
- package/es/core/keybinding/vs/configuration/json.d.ts.map +1 -0
- package/es/core/keybinding/vs/configuration/json.js +1303 -0
- package/es/core/keybinding/vs/contextKeyService.d.ts +73 -0
- package/es/core/keybinding/vs/contextKeyService.d.ts.map +1 -0
- package/es/core/keybinding/vs/contextKeyService.js +755 -0
- package/es/core/keybinding/vs/contextkey.d.ts +338 -0
- package/es/core/keybinding/vs/contextkey.d.ts.map +1 -0
- package/es/core/keybinding/vs/contextkey.js +1551 -0
- package/es/core/keybinding/vs/contextkeys.d.ts +10 -0
- package/es/core/keybinding/vs/contextkeys.d.ts.map +1 -0
- package/es/core/keybinding/vs/contextkeys.js +16 -0
- package/es/core/keybinding/vs/jsonContributionRegistry.d.ts +25 -0
- package/es/core/keybinding/vs/jsonContributionRegistry.d.ts.map +1 -0
- package/es/core/keybinding/vs/jsonContributionRegistry.js +52 -0
- package/es/core/keybinding/vs/jsonSchema.d.ts +65 -0
- package/es/core/keybinding/vs/jsonSchema.d.ts.map +1 -0
- package/es/core/keybinding/vs/jsonSchema.js +0 -0
- package/es/core/keybinding/vs/platform.d.ts +21 -0
- package/es/core/keybinding/vs/platform.d.ts.map +1 -0
- package/es/core/keybinding/vs/platform.js +39 -0
- package/es/core/keyboard/browser-keyboard-layout-provider.d.ts +101 -0
- package/es/core/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -0
- package/es/core/keyboard/browser-keyboard-layout-provider.js +642 -0
- package/es/core/keyboard/index.d.ts +5 -0
- package/es/core/keyboard/index.d.ts.map +1 -0
- package/es/core/keyboard/index.js +4 -0
- package/es/core/keyboard/keyboard-layout-service.d.ts +51 -0
- package/es/core/keyboard/keyboard-layout-service.d.ts.map +1 -0
- package/es/core/keyboard/keyboard-layout-service.js +697 -0
- package/es/core/keyboard/keyboard-protocol.d.ts +26 -0
- package/es/core/keyboard/keyboard-protocol.d.ts.map +1 -0
- package/es/core/keyboard/keyboard-protocol.js +5 -0
- package/es/core/keyboard/keys.d.ts +254 -0
- package/es/core/keyboard/keys.d.ts.map +1 -0
- package/es/core/keyboard/keys.js +1070 -0
- package/es/core/keyboard/layouts/cs-Czech-mac.d.ts +269 -0
- package/es/core/keyboard/layouts/cs-Czech-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/cs-Czech-mac.js +267 -0
- package/es/core/keyboard/layouts/cs-Czech-mac.json +1 -0
- package/es/core/keyboard/layouts/cs-Czech-pc.d.ts +291 -0
- package/es/core/keyboard/layouts/cs-Czech-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/cs-Czech-pc.js +289 -0
- package/es/core/keyboard/layouts/cs-Czech-pc.json +1 -0
- package/es/core/keyboard/layouts/da-Danish-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/da-Danish-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/da-Danish-mac.js +296 -0
- package/es/core/keyboard/layouts/da-Danish-mac.json +1 -0
- package/es/core/keyboard/layouts/da-Danish-pc.d.ts +270 -0
- package/es/core/keyboard/layouts/da-Danish-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/da-Danish-pc.js +268 -0
- package/es/core/keyboard/layouts/da-Danish-pc.json +1 -0
- package/es/core/keyboard/layouts/de-German-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/de-German-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/de-German-mac.js +296 -0
- package/es/core/keyboard/layouts/de-German-mac.json +1 -0
- package/es/core/keyboard/layouts/de-German-pc.d.ts +270 -0
- package/es/core/keyboard/layouts/de-German-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/de-German-pc.js +268 -0
- package/es/core/keyboard/layouts/de-German-pc.json +1 -0
- package/es/core/keyboard/layouts/de-Swiss_German-mac.d.ts +296 -0
- package/es/core/keyboard/layouts/de-Swiss_German-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/de-Swiss_German-mac.js +294 -0
- package/es/core/keyboard/layouts/de-Swiss_German-mac.json +1 -0
- package/es/core/keyboard/layouts/de-Swiss_German-pc.d.ts +273 -0
- package/es/core/keyboard/layouts/de-Swiss_German-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/de-Swiss_German-pc.js +271 -0
- package/es/core/keyboard/layouts/de-Swiss_German-pc.json +1 -0
- package/es/core/keyboard/layouts/en-British-mac.d.ts +296 -0
- package/es/core/keyboard/layouts/en-British-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-British-mac.js +294 -0
- package/es/core/keyboard/layouts/en-British-mac.json +1 -0
- package/es/core/keyboard/layouts/en-British-pc.d.ts +271 -0
- package/es/core/keyboard/layouts/en-British-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-British-pc.js +269 -0
- package/es/core/keyboard/layouts/en-British-pc.json +1 -0
- package/es/core/keyboard/layouts/en-Colemak-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/en-Colemak-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Colemak-mac.js +296 -0
- package/es/core/keyboard/layouts/en-Colemak-mac.json +1 -0
- package/es/core/keyboard/layouts/en-Dvorak-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/en-Dvorak-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Dvorak-mac.js +296 -0
- package/es/core/keyboard/layouts/en-Dvorak-mac.json +1 -0
- package/es/core/keyboard/layouts/en-Dvorak-pc.d.ts +257 -0
- package/es/core/keyboard/layouts/en-Dvorak-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Dvorak-pc.js +255 -0
- package/es/core/keyboard/layouts/en-Dvorak-pc.json +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-mac.js +296 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-mac.json +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-pc.d.ts +257 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-pc.js +255 -0
- package/es/core/keyboard/layouts/en-Dvorak_Lefthanded-pc.json +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-mac.js +296 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-mac.json +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-pc.d.ts +257 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-pc.js +255 -0
- package/es/core/keyboard/layouts/en-Dvorak_Righthanded-pc.json +1 -0
- package/es/core/keyboard/layouts/en-US-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/en-US-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-US-mac.js +296 -0
- package/es/core/keyboard/layouts/en-US-mac.json +1 -0
- package/es/core/keyboard/layouts/en-US-pc.d.ts +257 -0
- package/es/core/keyboard/layouts/en-US-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/en-US-pc.js +255 -0
- package/es/core/keyboard/layouts/en-US-pc.json +1 -0
- package/es/core/keyboard/layouts/es-Spanish-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/es-Spanish-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/es-Spanish-mac.js +296 -0
- package/es/core/keyboard/layouts/es-Spanish-mac.json +1 -0
- package/es/core/keyboard/layouts/es-Spanish-pc.d.ts +269 -0
- package/es/core/keyboard/layouts/es-Spanish-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/es-Spanish-pc.js +267 -0
- package/es/core/keyboard/layouts/es-Spanish-pc.json +1 -0
- package/es/core/keyboard/layouts/fr-Bepo-pc.d.ts +344 -0
- package/es/core/keyboard/layouts/fr-Bepo-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-Bepo-pc.js +342 -0
- package/es/core/keyboard/layouts/fr-Bepo-pc.json +1 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-mac.js +296 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-mac.json +1 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-pc.d.ts +281 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-pc.js +279 -0
- package/es/core/keyboard/layouts/fr-Canadian_French-pc.json +1 -0
- package/es/core/keyboard/layouts/fr-French-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/fr-French-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-French-mac.js +296 -0
- package/es/core/keyboard/layouts/fr-French-mac.json +1 -0
- package/es/core/keyboard/layouts/fr-French-pc.d.ts +269 -0
- package/es/core/keyboard/layouts/fr-French-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-French-pc.js +267 -0
- package/es/core/keyboard/layouts/fr-French-pc.json +1 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-mac.d.ts +296 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-mac.js +294 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-mac.json +1 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-pc.d.ts +273 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-pc.js +271 -0
- package/es/core/keyboard/layouts/fr-Swiss_French-pc.json +1 -0
- package/es/core/keyboard/layouts/hu-Hungarian-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/hu-Hungarian-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/hu-Hungarian-mac.js +296 -0
- package/es/core/keyboard/layouts/hu-Hungarian-mac.json +1 -0
- package/es/core/keyboard/layouts/hu-Hungarian-pc.d.ts +298 -0
- package/es/core/keyboard/layouts/hu-Hungarian-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/hu-Hungarian-pc.js +296 -0
- package/es/core/keyboard/layouts/hu-Hungarian-pc.json +1 -0
- package/es/core/keyboard/layouts/index.d.ts +4 -0
- package/es/core/keyboard/layouts/index.d.ts.map +1 -0
- package/es/core/keyboard/layouts/index.js +57 -0
- package/es/core/keyboard/layouts/it-Italian-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/it-Italian-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/it-Italian-mac.js +296 -0
- package/es/core/keyboard/layouts/it-Italian-mac.json +1 -0
- package/es/core/keyboard/layouts/it-Italian-pc.d.ts +265 -0
- package/es/core/keyboard/layouts/it-Italian-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/it-Italian-pc.js +263 -0
- package/es/core/keyboard/layouts/it-Italian-pc.json +1 -0
- package/es/core/keyboard/layouts/nb-Norwegian-mac.d.ts +293 -0
- package/es/core/keyboard/layouts/nb-Norwegian-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/nb-Norwegian-mac.js +291 -0
- package/es/core/keyboard/layouts/nb-Norwegian-mac.json +1 -0
- package/es/core/keyboard/layouts/nb-Norwegian-pc.d.ts +269 -0
- package/es/core/keyboard/layouts/nb-Norwegian-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/nb-Norwegian-pc.js +267 -0
- package/es/core/keyboard/layouts/nb-Norwegian-pc.json +1 -0
- package/es/core/keyboard/layouts/nl-Dutch-mac.d.ts +296 -0
- package/es/core/keyboard/layouts/nl-Dutch-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/nl-Dutch-mac.js +294 -0
- package/es/core/keyboard/layouts/nl-Dutch-mac.json +1 -0
- package/es/core/keyboard/layouts/nl-Dutch-pc.d.ts +278 -0
- package/es/core/keyboard/layouts/nl-Dutch-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/nl-Dutch-pc.js +276 -0
- package/es/core/keyboard/layouts/nl-Dutch-pc.json +1 -0
- package/es/core/keyboard/layouts/pl-Polish-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/pl-Polish-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/pl-Polish-mac.js +296 -0
- package/es/core/keyboard/layouts/pl-Polish-mac.json +1 -0
- package/es/core/keyboard/layouts/pl-Polish-pc.d.ts +284 -0
- package/es/core/keyboard/layouts/pl-Polish-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/pl-Polish-pc.js +282 -0
- package/es/core/keyboard/layouts/pl-Polish-pc.json +1 -0
- package/es/core/keyboard/layouts/pt-Brazilian-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/pt-Brazilian-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/pt-Brazilian-mac.js +296 -0
- package/es/core/keyboard/layouts/pt-Brazilian-mac.json +1 -0
- package/es/core/keyboard/layouts/pt-Portuguese-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/pt-Portuguese-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/pt-Portuguese-mac.js +296 -0
- package/es/core/keyboard/layouts/pt-Portuguese-mac.json +1 -0
- package/es/core/keyboard/layouts/pt-Portuguese-pc.d.ts +268 -0
- package/es/core/keyboard/layouts/pt-Portuguese-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/pt-Portuguese-pc.js +266 -0
- package/es/core/keyboard/layouts/pt-Portuguese-pc.json +65 -0
- package/es/core/keyboard/layouts/ro-Romanian-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/ro-Romanian-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/ro-Romanian-mac.js +296 -0
- package/es/core/keyboard/layouts/ro-Romanian-mac.json +1 -0
- package/es/core/keyboard/layouts/ro-Romanian-pc.d.ts +295 -0
- package/es/core/keyboard/layouts/ro-Romanian-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/ro-Romanian-pc.js +293 -0
- package/es/core/keyboard/layouts/ro-Romanian-pc.json +1 -0
- package/es/core/keyboard/layouts/sv-Swedish-mac.d.ts +298 -0
- package/es/core/keyboard/layouts/sv-Swedish-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/sv-Swedish-mac.js +296 -0
- package/es/core/keyboard/layouts/sv-Swedish-mac.json +1 -0
- package/es/core/keyboard/layouts/sv-Swedish-pc.d.ts +270 -0
- package/es/core/keyboard/layouts/sv-Swedish-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/sv-Swedish-pc.js +268 -0
- package/es/core/keyboard/layouts/sv-Swedish-pc.json +1 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-mac.d.ts +297 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-mac.d.ts.map +1 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-mac.js +295 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-mac.json +1 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-pc.d.ts +282 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-pc.d.ts.map +1 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-pc.js +280 -0
- package/es/core/keyboard/layouts/tr-Turkish_Q-pc.json +1 -0
- package/es/core/menu/default-menu-node.d.ts +82 -0
- package/es/core/menu/default-menu-node.d.ts.map +1 -0
- package/es/core/menu/default-menu-node.js +205 -0
- package/es/core/menu/index.d.ts +5 -0
- package/es/core/menu/index.d.ts.map +1 -0
- package/es/core/menu/index.js +39 -0
- package/es/core/menu/menu-protocol.d.ts +101 -0
- package/es/core/menu/menu-protocol.d.ts.map +1 -0
- package/es/core/menu/menu-protocol.js +72 -0
- package/es/core/menu/menu-registry.d.ts +92 -0
- package/es/core/menu/menu-registry.d.ts.map +1 -0
- package/es/core/menu/menu-registry.js +296 -0
- package/es/core/menu/module.d.ts +3 -0
- package/es/core/menu/module.d.ts.map +1 -0
- package/es/core/menu/module.js +31 -0
- package/es/core/module/index.d.ts +4 -0
- package/es/core/module/index.d.ts.map +1 -0
- package/es/core/module/index.js +3 -0
- package/es/core/module/mana-module-context.d.ts +7 -0
- package/es/core/module/mana-module-context.d.ts.map +1 -0
- package/es/core/module/mana-module-context.js +111 -0
- package/es/core/module/mana-module.d.ts +21 -0
- package/es/core/module/mana-module.d.ts.map +1 -0
- package/es/core/module/mana-module.js +71 -0
- package/es/core/module/module-protocol.d.ts +10 -0
- package/es/core/module/module-protocol.d.ts.map +1 -0
- package/es/core/module/module-protocol.js +1 -0
- package/es/core/nls.d.ts +19 -0
- package/es/core/nls.d.ts.map +1 -0
- package/es/core/nls.js +25 -0
- package/es/core/selection/index.d.ts +4 -0
- package/es/core/selection/index.d.ts.map +1 -0
- package/es/core/selection/index.js +4 -0
- package/es/core/selection/selection-service.d.ts +13 -0
- package/es/core/selection/selection-service.d.ts.map +1 -0
- package/es/core/selection/selection-service.js +27 -0
- package/es/core/theme/base-variable-registry.d.ts +31 -0
- package/es/core/theme/base-variable-registry.d.ts.map +1 -0
- package/es/core/theme/base-variable-registry.js +180 -0
- package/es/core/theme/basic/antd-variable-contribution.d.ts +6 -0
- package/es/core/theme/basic/antd-variable-contribution.d.ts.map +1 -0
- package/es/core/theme/basic/antd-variable-contribution.js +667 -0
- package/es/core/theme/basic/default-variable-contribution.d.ts +6 -0
- package/es/core/theme/basic/default-variable-contribution.d.ts.map +1 -0
- package/es/core/theme/basic/default-variable-contribution.js +212 -0
- package/es/core/theme/basic/index.d.ts +3 -0
- package/es/core/theme/basic/index.d.ts.map +1 -0
- package/es/core/theme/basic/index.js +2 -0
- package/es/core/theme/basic/variable-protocol.d.ts +7 -0
- package/es/core/theme/basic/variable-protocol.d.ts.map +1 -0
- package/es/core/theme/basic/variable-protocol.js +2 -0
- package/es/core/theme/basic/variable-registry.d.ts +13 -0
- package/es/core/theme/basic/variable-registry.d.ts.map +1 -0
- package/es/core/theme/basic/variable-registry.js +62 -0
- package/es/core/theme/color/antd-color-contribution.d.ts +6 -0
- package/es/core/theme/color/antd-color-contribution.d.ts.map +1 -0
- package/es/core/theme/color/antd-color-contribution.js +787 -0
- package/es/core/theme/color/color-protocol.d.ts +10 -0
- package/es/core/theme/color/color-protocol.d.ts.map +1 -0
- package/es/core/theme/color/color-protocol.js +2 -0
- package/es/core/theme/color/color-registry.d.ts +72 -0
- package/es/core/theme/color/color-registry.d.ts.map +1 -0
- package/es/core/theme/color/color-registry.js +176 -0
- package/es/core/theme/color/color.d.ts +165 -0
- package/es/core/theme/color/color.d.ts.map +1 -0
- package/es/core/theme/color/color.js +658 -0
- package/es/core/theme/color/default-color-contribution.d.ts +6 -0
- package/es/core/theme/color/default-color-contribution.d.ts.map +1 -0
- package/es/core/theme/color/default-color-contribution.js +550 -0
- package/es/core/theme/color/index.d.ts +3 -0
- package/es/core/theme/color/index.d.ts.map +1 -0
- package/es/core/theme/color/index.js +2 -0
- package/es/core/theme/index.d.ts +8 -0
- package/es/core/theme/index.d.ts.map +1 -0
- package/es/core/theme/index.js +22 -0
- package/es/core/theme/protocol.d.ts +16 -0
- package/es/core/theme/protocol.d.ts.map +1 -0
- package/es/core/theme/protocol.js +1 -0
- package/es/core/theme/style/mana-logo.png +0 -0
- package/es/core/theme/style/theme-base.less +3 -0
- package/es/core/theme/theme-app.d.ts +24 -0
- package/es/core/theme/theme-app.d.ts.map +1 -0
- package/es/core/theme/theme-app.js +151 -0
- package/es/core/theme/theme-service.d.ts +50 -0
- package/es/core/theme/theme-service.d.ts.map +1 -0
- package/es/core/theme/theme-service.js +181 -0
- package/es/core/toolbar/default-toolbar-item.d.ts +38 -0
- package/es/core/toolbar/default-toolbar-item.d.ts.map +1 -0
- package/es/core/toolbar/default-toolbar-item.js +82 -0
- package/es/core/toolbar/index.d.ts +6 -0
- package/es/core/toolbar/index.d.ts.map +1 -0
- package/es/core/toolbar/index.js +20 -0
- package/es/core/toolbar/toolbar-protocol.d.ts +77 -0
- package/es/core/toolbar/toolbar-protocol.d.ts.map +1 -0
- package/es/core/toolbar/toolbar-protocol.js +32 -0
- package/es/core/toolbar/toolbar-registry.d.ts +37 -0
- package/es/core/toolbar/toolbar-registry.d.ts.map +1 -0
- package/es/core/toolbar/toolbar-registry.js +96 -0
- package/es/core/typings/native-keymap.d.ts +72 -0
- package/es/core/utils/hooks.d.ts +12 -0
- package/es/core/utils/hooks.d.ts.map +1 -0
- package/es/core/utils/hooks.js +103 -0
- package/es/core/utils/index.d.ts +4 -0
- package/es/core/utils/index.d.ts.map +1 -0
- package/es/core/utils/index.js +3 -0
- package/es/core/utils/lifecycle.d.ts +75 -0
- package/es/core/utils/lifecycle.d.ts.map +1 -0
- package/es/core/utils/lifecycle.js +350 -0
- package/es/core/utils/map.d.ts +148 -0
- package/es/core/utils/map.d.ts.map +1 -0
- package/es/core/utils/map.js +1196 -0
- package/es/core/view/decorator.d.ts +19 -0
- package/es/core/view/decorator.d.ts.map +1 -0
- package/es/core/view/decorator.js +106 -0
- package/es/core/view/default-slot-view.d.ts +48 -0
- package/es/core/view/default-slot-view.d.ts.map +1 -0
- package/es/core/view/default-slot-view.js +289 -0
- package/es/core/view/default-view.d.ts +35 -0
- package/es/core/view/default-view.d.ts.map +1 -0
- package/es/core/view/default-view.js +90 -0
- package/es/core/view/focus-tracker.d.ts +165 -0
- package/es/core/view/focus-tracker.d.ts.map +1 -0
- package/es/core/view/focus-tracker.js +411 -0
- package/es/core/view/hooks.d.ts +8 -0
- package/es/core/view/hooks.d.ts.map +1 -0
- package/es/core/view/hooks.js +35 -0
- package/es/core/view/index.d.ts +23 -0
- package/es/core/view/index.d.ts.map +1 -0
- package/es/core/view/index.js +22 -0
- package/es/core/view/index.less +4 -0
- package/es/core/view/module.d.ts +3 -0
- package/es/core/view/module.d.ts.map +1 -0
- package/es/core/view/module.js +22 -0
- package/es/core/view/navigatable-types.d.ts +33 -0
- package/es/core/view/navigatable-types.d.ts.map +1 -0
- package/es/core/view/navigatable-types.js +34 -0
- package/es/core/view/navigatable.d.ts +9 -0
- package/es/core/view/navigatable.d.ts.map +1 -0
- package/es/core/view/navigatable.js +47 -0
- package/es/core/view/open-handler.d.ts +71 -0
- package/es/core/view/open-handler.d.ts.map +1 -0
- package/es/core/view/open-handler.js +167 -0
- package/es/core/view/portal-slot-view.d.ts +21 -0
- package/es/core/view/portal-slot-view.d.ts.map +1 -0
- package/es/core/view/portal-slot-view.js +157 -0
- package/es/core/view/root-view.d.ts +26 -0
- package/es/core/view/root-view.d.ts.map +1 -0
- package/es/core/view/root-view.js +139 -0
- package/es/core/view/saveable.d.ts +40 -0
- package/es/core/view/saveable.d.ts.map +1 -0
- package/es/core/view/saveable.js +152 -0
- package/es/core/view/slot-view-manager.d.ts +57 -0
- package/es/core/view/slot-view-manager.d.ts.map +1 -0
- package/es/core/view/slot-view-manager.js +321 -0
- package/es/core/view/slot.d.ts +11 -0
- package/es/core/view/slot.d.ts.map +1 -0
- package/es/core/view/slot.js +57 -0
- package/es/core/view/stateful-view.d.ts +12 -0
- package/es/core/view/stateful-view.d.ts.map +1 -0
- package/es/core/view/stateful-view.js +38 -0
- package/es/core/view/title.d.ts +13 -0
- package/es/core/view/title.d.ts.map +1 -0
- package/es/core/view/title.js +48 -0
- package/es/core/view/utils.d.ts +15 -0
- package/es/core/view/utils.d.ts.map +1 -0
- package/es/core/view/utils.js +35 -0
- package/es/core/view/view-application.d.ts +18 -0
- package/es/core/view/view-application.d.ts.map +1 -0
- package/es/core/view/view-application.js +171 -0
- package/es/core/view/view-container.d.ts +20 -0
- package/es/core/view/view-container.d.ts.map +1 -0
- package/es/core/view/view-container.js +82 -0
- package/es/core/view/view-context.d.ts +8 -0
- package/es/core/view/view-context.d.ts.map +1 -0
- package/es/core/view/view-context.js +29 -0
- package/es/core/view/view-decoration.d.ts +149 -0
- package/es/core/view/view-decoration.d.ts.map +1 -0
- package/es/core/view/view-decoration.js +4 -0
- package/es/core/view/view-manager.d.ts +66 -0
- package/es/core/view/view-manager.d.ts.map +1 -0
- package/es/core/view/view-manager.js +434 -0
- package/es/core/view/view-meta.d.ts +12 -0
- package/es/core/view/view-meta.d.ts.map +1 -0
- package/es/core/view/view-meta.js +35 -0
- package/es/core/view/view-open-handler.d.ts +76 -0
- package/es/core/view/view-open-handler.d.ts.map +1 -0
- package/es/core/view/view-open-handler.js +227 -0
- package/es/core/view/view-protocol.d.ts +171 -0
- package/es/core/view/view-protocol.d.ts.map +1 -0
- package/es/core/view/view-protocol.js +58 -0
- package/es/core/view/view-render.d.ts +9 -0
- package/es/core/view/view-render.d.ts.map +1 -0
- package/es/core/view/view-render.js +37 -0
- package/es/core/view/view-storage.d.ts +40 -0
- package/es/core/view/view-storage.d.ts.map +1 -0
- package/es/core/view/view-storage.js +310 -0
- package/es/index.js +2 -1
- package/es/ioc/container-api.d.ts +9 -0
- package/es/ioc/container-api.d.ts.map +1 -0
- package/es/ioc/container-api.js +32 -0
- package/es/ioc/container.d.ts +37 -0
- package/es/ioc/container.d.ts.map +1 -0
- package/es/ioc/container.js +191 -0
- package/es/ioc/contribution/contribution-protocol.d.ts +24 -0
- package/es/ioc/contribution/contribution-protocol.d.ts.map +1 -0
- package/es/ioc/contribution/contribution-protocol.js +16 -0
- package/es/ioc/contribution/contribution-provider.d.ts +21 -0
- package/es/ioc/contribution/contribution-provider.d.ts.map +1 -0
- package/es/ioc/contribution/contribution-provider.js +81 -0
- package/es/ioc/contribution/contribution-register.d.ts +5 -0
- package/es/ioc/contribution/contribution-register.d.ts.map +1 -0
- package/es/ioc/contribution/contribution-register.js +27 -0
- package/es/ioc/contribution/decorator.d.ts +3 -0
- package/es/ioc/contribution/decorator.d.ts.map +1 -0
- package/es/ioc/contribution/decorator.js +8 -0
- package/es/ioc/contribution/index.d.ts +12 -0
- package/es/ioc/contribution/index.d.ts.map +1 -0
- package/es/ioc/contribution/index.js +10 -0
- package/es/ioc/core.d.ts +105 -0
- package/es/ioc/core.d.ts.map +1 -0
- package/es/ioc/core.js +104 -0
- package/es/ioc/decorator.d.ts +9 -0
- package/es/ioc/decorator.d.ts.map +1 -0
- package/es/ioc/decorator.js +56 -0
- package/es/ioc/features/auto-factory.d.ts +8 -0
- package/es/ioc/features/auto-factory.d.ts.map +1 -0
- package/es/ioc/features/auto-factory.js +34 -0
- package/es/ioc/features/prioritized-contribution.d.ts +12 -0
- package/es/ioc/features/prioritized-contribution.d.ts.map +1 -0
- package/es/ioc/features/prioritized-contribution.js +40 -0
- package/es/ioc/index.d.ts +9 -0
- package/es/ioc/index.d.ts.map +1 -0
- package/es/ioc/index.js +8 -0
- package/es/ioc/inversify-api/index.d.ts +15 -0
- package/es/ioc/inversify-api/index.d.ts.map +1 -0
- package/es/ioc/inversify-api/index.js +48 -0
- package/es/ioc/inversify-api/inversify-protocol.d.ts +13 -0
- package/es/ioc/inversify-api/inversify-protocol.d.ts.map +1 -0
- package/es/ioc/inversify-api/inversify-protocol.js +7 -0
- package/es/ioc/module/index.d.ts +4 -0
- package/es/ioc/module/index.d.ts.map +1 -0
- package/es/ioc/module/index.js +5 -0
- package/es/ioc/module/syringe-module.d.ts +29 -0
- package/es/ioc/module/syringe-module.d.ts.map +1 -0
- package/es/ioc/module/syringe-module.js +110 -0
- package/es/ioc/register.d.ts +33 -0
- package/es/ioc/register.d.ts.map +1 -0
- package/es/ioc/register.js +194 -0
- package/es/ioc/side-option.d.ts +4 -0
- package/es/ioc/side-option.d.ts.map +1 -0
- package/es/ioc/side-option.js +4 -0
- package/es/l10n/index.d.ts +3 -0
- package/es/l10n/index.d.ts.map +1 -0
- package/es/l10n/index.js +2 -0
- package/es/l10n/l10n/index.d.ts +144 -0
- package/es/l10n/l10n/index.d.ts.map +1 -0
- package/es/l10n/l10n/index.js +269 -0
- package/es/l10n/l10n/platform.d.ts +3 -0
- package/es/l10n/l10n/platform.d.ts.map +1 -0
- package/es/l10n/l10n/platform.js +20 -0
- package/es/l10n/lang/bundle.l10n.en-US.json +5 -0
- package/es/l10n/lang/bundle.l10n.zh-CN.json +5 -0
- package/es/l10n/lang/index.d.ts +3 -0
- package/es/l10n/lang/index.d.ts.map +1 -0
- package/es/l10n/lang/index.js +6 -0
- package/es/observable/async-event.d.ts +28 -0
- package/es/observable/async-event.d.ts.map +1 -0
- package/es/observable/async-event.js +158 -0
- package/es/observable/config.d.ts +10 -0
- package/es/observable/config.d.ts.map +1 -0
- package/es/observable/config.js +58 -0
- package/es/observable/context.d.ts +15 -0
- package/es/observable/context.d.ts.map +1 -0
- package/es/observable/context.js +44 -0
- package/es/observable/core.d.ts +24 -0
- package/es/observable/core.d.ts.map +1 -0
- package/es/observable/core.js +11 -0
- package/es/observable/decorator.d.ts +9 -0
- package/es/observable/decorator.d.ts.map +1 -0
- package/es/observable/decorator.js +19 -0
- package/es/observable/hooks.d.ts +6 -0
- package/es/observable/hooks.d.ts.map +1 -0
- package/es/observable/hooks.js +44 -0
- package/es/observable/index.d.ts +12 -0
- package/es/observable/index.d.ts.map +1 -0
- package/es/observable/index.js +11 -0
- package/es/observable/notifiable.d.ts +19 -0
- package/es/observable/notifiable.d.ts.map +1 -0
- package/es/observable/notifiable.js +198 -0
- package/es/observable/notifier.d.ts +33 -0
- package/es/observable/notifier.d.ts.map +1 -0
- package/es/observable/notifier.js +154 -0
- package/es/observable/observable.d.ts +3 -0
- package/es/observable/observable.d.ts.map +1 -0
- package/es/observable/observable.js +87 -0
- package/es/observable/tracker.d.ts +27 -0
- package/es/observable/tracker.d.ts.map +1 -0
- package/es/observable/tracker.js +225 -0
- package/es/observable/utils.d.ts +31 -0
- package/es/observable/utils.d.ts.map +1 -0
- package/es/observable/utils.js +139 -0
- package/es/observable/watch.d.ts +5 -0
- package/es/observable/watch.d.ts.map +1 -0
- package/es/observable/watch.js +56 -0
- package/es/polling/poll.d.ts +3 -3
- package/es/polling/poll.d.ts.map +1 -1
- package/es/polling/poll.js +1 -1
- package/es/polling/protocol.d.ts +1 -1
- package/es/polling/protocol.d.ts.map +1 -1
- package/es/protocol/cell-protocol.d.ts +1 -1
- package/es/protocol/cell-protocol.d.ts.map +1 -1
- package/es/protocol/cell-protocol.js +1 -1
- package/es/react/constant.d.ts +2 -0
- package/es/react/constant.d.ts.map +1 -0
- package/es/react/constant.js +1 -0
- package/es/react/dropdown/index.d.ts +23 -0
- package/es/react/dropdown/index.d.ts.map +1 -0
- package/es/react/dropdown/index.js +53 -0
- package/es/react/dropdown/styles/index.less +121 -0
- package/es/react/index.d.ts +8 -0
- package/es/react/index.d.ts.map +1 -0
- package/es/react/index.js +7 -0
- package/es/react/layout/boxpanel/Pane.d.ts +13 -0
- package/es/react/layout/boxpanel/Pane.d.ts.map +1 -0
- package/es/react/layout/boxpanel/Pane.js +37 -0
- package/es/react/layout/boxpanel/context.d.ts +8 -0
- package/es/react/layout/boxpanel/context.d.ts.map +1 -0
- package/es/react/layout/boxpanel/context.js +4 -0
- package/es/react/layout/boxpanel/index.d.ts +19 -0
- package/es/react/layout/boxpanel/index.d.ts.map +1 -0
- package/es/react/layout/boxpanel/index.js +46 -0
- package/es/react/layout/boxpanel/styles/index.less +14 -0
- package/es/react/layout/layout.d.ts +12 -0
- package/es/react/layout/layout.d.ts.map +1 -0
- package/es/react/layout/layout.js +68 -0
- package/es/react/layout/splitpanel/context.d.ts +15 -0
- package/es/react/layout/splitpanel/context.d.ts.map +1 -0
- package/es/react/layout/splitpanel/context.js +24 -0
- package/es/react/layout/splitpanel/index.d.ts +23 -0
- package/es/react/layout/splitpanel/index.d.ts.map +1 -0
- package/es/react/layout/splitpanel/index.js +287 -0
- package/es/react/layout/splitpanel/pane.d.ts +18 -0
- package/es/react/layout/splitpanel/pane.d.ts.map +1 -0
- package/es/react/layout/splitpanel/pane.js +8 -0
- package/es/react/layout/splitpanel/styles/index.less +10 -0
- package/es/react/menu/context.d.ts +8 -0
- package/es/react/menu/context.d.ts.map +1 -0
- package/es/react/menu/context.js +4 -0
- package/es/react/menu/divider.d.ts +3 -0
- package/es/react/menu/divider.d.ts.map +1 -0
- package/es/react/menu/divider.js +10 -0
- package/es/react/menu/index.d.ts +4 -0
- package/es/react/menu/index.d.ts.map +1 -0
- package/es/react/menu/index.js +3 -0
- package/es/react/menu/item.d.ts +19 -0
- package/es/react/menu/item.d.ts.map +1 -0
- package/es/react/menu/item.js +69 -0
- package/es/react/menu/menu.d.ts +17 -0
- package/es/react/menu/menu.d.ts.map +1 -0
- package/es/react/menu/menu.js +35 -0
- package/es/react/menu/styles/index.less +163 -0
- package/es/react/menu/submenu.d.ts +5 -0
- package/es/react/menu/submenu.d.ts.map +1 -0
- package/es/react/menu/submenu.js +33 -0
- package/es/react/menubar/context.d.ts +14 -0
- package/es/react/menubar/context.d.ts.map +1 -0
- package/es/react/menubar/context.js +2 -0
- package/es/react/menubar/index.d.ts +2 -0
- package/es/react/menubar/index.d.ts.map +1 -0
- package/es/react/menubar/index.js +1 -0
- package/es/react/menubar/item.d.ts +8 -0
- package/es/react/menubar/item.d.ts.map +1 -0
- package/es/react/menubar/item.js +94 -0
- package/es/react/menubar/menubar.d.ts +15 -0
- package/es/react/menubar/menubar.d.ts.map +1 -0
- package/es/react/menubar/menubar.js +119 -0
- package/es/react/menubar/styles/index.less +113 -0
- package/es/react/notification/index.d.ts +20 -0
- package/es/react/notification/index.d.ts.map +1 -0
- package/es/react/notification/index.js +154 -0
- package/es/react/notification/protocol.d.ts +111 -0
- package/es/react/notification/protocol.d.ts.map +1 -0
- package/es/react/notification/protocol.js +61 -0
- package/es/react/notification/pure-panel.d.ts +28 -0
- package/es/react/notification/pure-panel.d.ts.map +1 -0
- package/es/react/notification/pure-panel.js +115 -0
- package/es/react/notification/render.d.ts +10 -0
- package/es/react/notification/render.d.ts.map +1 -0
- package/es/react/notification/render.js +101 -0
- package/es/react/notification/style/index.d.ts +2 -0
- package/es/react/notification/style/index.d.ts.map +1 -0
- package/es/react/notification/style/index.js +1 -0
- package/es/react/notification/style/index.less +192 -0
- package/es/react/notification/style/placement.less +68 -0
- package/es/react/notification/use-notification.d.ts +9 -0
- package/es/react/notification/use-notification.d.ts.map +1 -0
- package/es/react/notification/use-notification.js +173 -0
- package/es/react/resize/index.d.ts +41 -0
- package/es/react/resize/index.d.ts.map +1 -0
- package/es/react/resize/index.js +640 -0
- package/es/react/resize/styles/index.less +83 -0
- package/es/react/styles/variables.less +2 -0
- package/es/react/tabs/index.d.ts +19 -0
- package/es/react/tabs/index.d.ts.map +1 -0
- package/es/react/tabs/index.js +51 -0
- package/es/react/tabs/styles/card.less +111 -0
- package/es/react/tabs/styles/dropdown.less +70 -0
- package/es/react/tabs/styles/index.less +231 -0
- package/es/react/tabs/styles/position.less +217 -0
- package/es/react/typings/index.d.ts +5 -0
- package/es/react/util.d.ts +2 -0
- package/es/react/util.d.ts.map +1 -0
- package/es/react/util.js +4 -0
- package/es/url.js +1 -1
- package/package.json +55 -11
- package/src/app/app.tsx +23 -0
- package/src/app/file-tree/file-selection.ts +33 -0
- package/src/app/file-tree/file-service.ts +67 -0
- package/src/app/file-tree/file-tree-component.tsx +11 -0
- package/src/app/file-tree/file-tree-icon.tsx +15 -0
- package/src/app/file-tree/file-tree-label-provider.ts +54 -0
- package/src/app/file-tree/file-tree-model.ts +240 -0
- package/src/app/file-tree/file-tree-protocol.ts +35 -0
- package/src/app/file-tree/file-tree-view.tsx +340 -0
- package/src/app/file-tree/file-tree.ts +193 -0
- package/src/app/file-tree/files.ts +990 -0
- package/src/app/file-tree/filesystem-utils.ts +32 -0
- package/src/app/file-tree/index.ts +6 -0
- package/src/app/file-tree/module.ts +21 -0
- package/src/app/file-tree/selection-command-handler.ts +101 -0
- package/src/app/file-tree/style/file-icon.less +51 -0
- package/src/app/index.spec.ts +20 -0
- package/src/app/index.ts +37 -0
- package/src/app/label/index.ts +12 -0
- package/src/app/label/label-provider.tsx +454 -0
- package/src/app/menu/index.ts +24 -0
- package/src/app/menu/menu-bar-render.tsx +52 -0
- package/src/app/menu/menu-color-registry.ts +52 -0
- package/src/app/menu/menu-context.tsx +16 -0
- package/src/app/menu/menu-item-keeper.tsx +55 -0
- package/src/app/menu/menu-item-render.tsx +15 -0
- package/src/app/menu/menu-protocol.ts +22 -0
- package/src/app/menu/menu-render.tsx +92 -0
- package/src/app/menu/menu.tsx +212 -0
- package/src/app/modal/index.ts +29 -0
- package/src/app/modal/modal-contribution.ts +13 -0
- package/src/app/modal/modal-protocol.tsx +30 -0
- package/src/app/modal/modal-render.tsx +22 -0
- package/src/app/modal/modal-service.ts +166 -0
- package/src/app/notification/index.less +20 -0
- package/src/app/notification/index.ts +8 -0
- package/src/app/notification/protocol.ts +16 -0
- package/src/app/notification/service.tsx +60 -0
- package/src/app/style/index.less +181 -0
- package/src/app/style/style-protocol.ts +13 -0
- package/src/app/toolbar/index.less +40 -0
- package/src/app/toolbar/index.ts +20 -0
- package/src/app/toolbar/toolbar-item-keeper.tsx +45 -0
- package/src/app/toolbar/toolbar-item-render.tsx +23 -0
- package/src/app/toolbar/toolbar-protocol.ts +10 -0
- package/src/app/toolbar/toolbar-render.tsx +102 -0
- package/src/app/toolbar/toolbar-visible-render.tsx +21 -0
- package/src/app/toolbar/toolbar.tsx +241 -0
- package/src/app/tree/components/index.tsx +22 -0
- package/src/app/tree/components/tree-ident.tsx +44 -0
- package/src/app/tree/components/tree-node-caption-affix.tsx +47 -0
- package/src/app/tree/components/tree-node-caption.tsx +128 -0
- package/src/app/tree/components/tree-node-expansion.tsx +36 -0
- package/src/app/tree/components/tree-node-icon-decorator.tsx +75 -0
- package/src/app/tree/components/tree-node-icon.tsx +3 -0
- package/src/app/tree/components/tree-node-tail-decoration.tsx +59 -0
- package/src/app/tree/components/tree-node.tsx +38 -0
- package/src/app/tree/components/tree-switch-icon.tsx +13 -0
- package/src/app/tree/index.ts +15 -0
- package/src/app/tree/module.ts +30 -0
- package/src/app/tree/style/index.less +206 -0
- package/src/app/tree/style/tree-decorator.less +65 -0
- package/src/app/tree/tree-decorator.ts +216 -0
- package/src/app/tree/tree-expansion.ts +162 -0
- package/src/app/tree/tree-impl.ts +182 -0
- package/src/app/tree/tree-iterator.ts +243 -0
- package/src/app/tree/tree-label-provider.ts +23 -0
- package/src/app/tree/tree-model.ts +468 -0
- package/src/app/tree/tree-navigation.ts +41 -0
- package/src/app/tree/tree-protocol.ts +77 -0
- package/src/app/tree/tree-selection-impl.ts +169 -0
- package/src/app/tree/tree-selection-state.ts +271 -0
- package/src/app/tree/tree-selection.ts +138 -0
- package/src/app/tree/tree-view-decoration.ts +349 -0
- package/src/app/tree/tree.ts +288 -0
- package/src/app/tree/view/index.less +3 -0
- package/src/app/tree/view/index.ts +3 -0
- package/src/app/tree/view/tree-view-decorator.ts +91 -0
- package/src/app/tree/view/tree-view-module.ts +16 -0
- package/src/app/tree/view/tree-view-selection.ts +33 -0
- package/src/app/tree/view/tree-view.tsx +925 -0
- package/src/app/typings/index.d.ts +7 -0
- package/src/app/view/box/index.tsx +66 -0
- package/src/app/view/components/index.ts +1 -0
- package/src/app/view/components/loading/index.less +10 -0
- package/src/app/view/components/loading/index.tsx +4 -0
- package/src/app/view/flex/index.less +3 -0
- package/src/app/view/flex/index.tsx +57 -0
- package/src/app/view/header/header-view.tsx +35 -0
- package/src/app/view/header/index.less +43 -0
- package/src/app/view/header/index.ts +24 -0
- package/src/app/view/index.ts +15 -0
- package/src/app/view/tab/card-tab-view.tsx +34 -0
- package/src/app/view/tab/index.less +70 -0
- package/src/app/view/tab/index.ts +3 -0
- package/src/app/view/tab/side-tab-view.tsx +95 -0
- package/src/app/view/tab/tab-menu.ts +24 -0
- package/src/app/view/tab/tab-protocol.ts +3 -0
- package/src/app/view/tab/tab-view.tsx +153 -0
- package/src/common/assert.ts +13 -0
- package/src/common/cancellation.spec.ts +160 -0
- package/src/common/cancellation.ts +143 -0
- package/src/common/charCode.ts +434 -0
- package/src/common/collections.ts +158 -0
- package/src/common/deferred.ts +17 -0
- package/src/common/disposable-collection.ts +87 -0
- package/src/common/disposable.spec.ts +93 -0
- package/src/common/disposable.ts +41 -0
- package/src/common/event.spec.ts +182 -0
- package/src/common/event.ts +249 -0
- package/src/common/index.ts +27 -0
- package/src/common/iterator.ts +228 -0
- package/src/common/linkedList.ts +125 -0
- package/src/common/objects.ts +249 -0
- package/src/common/observable-disposable.ts +12 -0
- package/src/common/path.spec.ts +33 -0
- package/src/common/path.ts +226 -0
- package/src/common/platform.ts +281 -0
- package/src/common/priority.ts +79 -0
- package/src/common/promise-util.spec.ts +68 -0
- package/src/common/promise-util.ts +34 -0
- package/src/common/stopwatch.ts +40 -0
- package/src/common/strings.ts +513 -0
- package/src/common/types.spec.ts +16 -0
- package/src/common/types.ts +30 -0
- package/src/common/uint.ts +59 -0
- package/src/common/uri.spec.ts +73 -0
- package/src/common/uri.ts +208 -0
- package/src/common/utils.spec.ts +22 -0
- package/src/common/utils.ts +35 -0
- package/src/common/valueTypes.ts +311 -0
- package/src/common/vscode-uri/char-code.ts +438 -0
- package/src/common/vscode-uri/index.ts +11 -0
- package/src/common/vscode-uri/platform.ts +20 -0
- package/src/common/vscode-uri/uri.ts +757 -0
- package/src/common/vscode-uri/utils.ts +101 -0
- package/src/common/wait-until-event.spec.ts +70 -0
- package/src/common/wait-until-event.ts +49 -0
- package/src/core/application/application-protocol.ts +20 -0
- package/src/core/application/application-state.ts +68 -0
- package/src/core/application/application.ts +294 -0
- package/src/core/application/default-window-service.ts +66 -0
- package/src/core/application/index.ts +12 -0
- package/src/core/application/mock-window-service.ts +17 -0
- package/src/core/browser.ts +144 -0
- package/src/core/command/command-protocol.ts +152 -0
- package/src/core/command/command-registry.ts +432 -0
- package/src/core/command/index.ts +10 -0
- package/src/core/common/debug.ts +6 -0
- package/src/core/common/index.ts +23 -0
- package/src/core/common/storage-protocol.ts +25 -0
- package/src/core/common/storage-service.ts +81 -0
- package/src/core/components/application.tsx +144 -0
- package/src/core/components/context.tsx +67 -0
- package/src/core/components/hooks.tsx +23 -0
- package/src/core/components/index.less +28 -0
- package/src/core/components/index.tsx +10 -0
- package/src/core/components/root-view-render.tsx +13 -0
- package/src/core/configuration/configuration-cache.ts +50 -0
- package/src/core/configuration/configuration-protocol.ts +55 -0
- package/src/core/configuration/configuration-provider.ts +105 -0
- package/src/core/configuration/configuration-registry.ts +237 -0
- package/src/core/configuration/configuration-render-registry.ts +93 -0
- package/src/core/configuration/configuration-service.ts +190 -0
- package/src/core/configuration/configuration-storage.ts +26 -0
- package/src/core/configuration/configuration.test.ts +7 -0
- package/src/core/configuration/hooks.ts +39 -0
- package/src/core/configuration/index.ts +10 -0
- package/src/core/configuration/module.ts +34 -0
- package/src/core/configuration/typings.d.ts +1 -0
- package/src/core/configuration/validation.ts +33 -0
- package/src/core/context/data-context-manager.ts +65 -0
- package/src/core/context/data-context-protocol.ts +21 -0
- package/src/core/context/data-context.tsx +40 -0
- package/src/core/context/index.ts +15 -0
- package/src/core/index.spec.ts +14 -0
- package/src/core/index.ts +57 -0
- package/src/core/keybinding/context-key-service.ts +77 -0
- package/src/core/keybinding/index.ts +5 -0
- package/src/core/keybinding/keybinding-proocol.ts +15 -0
- package/src/core/keybinding/keybinding.ts +857 -0
- package/src/core/keybinding/module.ts +23 -0
- package/src/core/keybinding/vs/configuration/configuration.ts +460 -0
- package/src/core/keybinding/vs/configuration/configurationModels.ts +962 -0
- package/src/core/keybinding/vs/configuration/configurationRegistry.ts +617 -0
- package/src/core/keybinding/vs/configuration/configurationService.ts +172 -0
- package/src/core/keybinding/vs/configuration/json.ts +1509 -0
- package/src/core/keybinding/vs/contextKeyService.ts +694 -0
- package/src/core/keybinding/vs/contextkey.ts +1494 -0
- package/src/core/keybinding/vs/contextkeys.ts +52 -0
- package/src/core/keybinding/vs/jsonContributionRegistry.ts +74 -0
- package/src/core/keybinding/vs/jsonSchema.ts +85 -0
- package/src/core/keybinding/vs/platform.test.ts +50 -0
- package/src/core/keybinding/vs/platform.ts +50 -0
- package/src/core/keyboard/browser-keyboard-layout-provider.ts +455 -0
- package/src/core/keyboard/index.ts +4 -0
- package/src/core/keyboard/keyboard-layout-service.ts +490 -0
- package/src/core/keyboard/keyboard-protocol.ts +34 -0
- package/src/core/keyboard/keys.ts +787 -0
- package/src/core/keyboard/layouts/cs-Czech-mac.json +1 -0
- package/src/core/keyboard/layouts/cs-Czech-mac.ts +53 -0
- package/src/core/keyboard/layouts/cs-Czech-pc.json +1 -0
- package/src/core/keyboard/layouts/cs-Czech-pc.ts +55 -0
- package/src/core/keyboard/layouts/da-Danish-mac.json +1 -0
- package/src/core/keyboard/layouts/da-Danish-mac.ts +53 -0
- package/src/core/keyboard/layouts/da-Danish-pc.json +1 -0
- package/src/core/keyboard/layouts/da-Danish-pc.ts +55 -0
- package/src/core/keyboard/layouts/de-German-mac.json +1 -0
- package/src/core/keyboard/layouts/de-German-mac.ts +53 -0
- package/src/core/keyboard/layouts/de-German-pc.json +1 -0
- package/src/core/keyboard/layouts/de-German-pc.ts +61 -0
- package/src/core/keyboard/layouts/de-Swiss_German-mac.json +1 -0
- package/src/core/keyboard/layouts/de-Swiss_German-mac.ts +53 -0
- package/src/core/keyboard/layouts/de-Swiss_German-pc.json +1 -0
- package/src/core/keyboard/layouts/de-Swiss_German-pc.ts +55 -0
- package/src/core/keyboard/layouts/en-British-mac.json +1 -0
- package/src/core/keyboard/layouts/en-British-mac.ts +53 -0
- package/src/core/keyboard/layouts/en-British-pc.json +1 -0
- package/src/core/keyboard/layouts/en-British-pc.ts +91 -0
- package/src/core/keyboard/layouts/en-Colemak-mac.json +1 -0
- package/src/core/keyboard/layouts/en-Colemak-mac.ts +53 -0
- package/src/core/keyboard/layouts/en-Dvorak-mac.json +1 -0
- package/src/core/keyboard/layouts/en-Dvorak-mac.ts +53 -0
- package/src/core/keyboard/layouts/en-Dvorak-pc.json +1 -0
- package/src/core/keyboard/layouts/en-Dvorak-pc.ts +55 -0
- package/src/core/keyboard/layouts/en-Dvorak_Lefthanded-mac.json +1 -0
- package/src/core/keyboard/layouts/en-Dvorak_Lefthanded-mac.ts +53 -0
- package/src/core/keyboard/layouts/en-Dvorak_Lefthanded-pc.json +1 -0
- package/src/core/keyboard/layouts/en-Dvorak_Lefthanded-pc.ts +55 -0
- package/src/core/keyboard/layouts/en-Dvorak_Righthanded-mac.json +1 -0
- package/src/core/keyboard/layouts/en-Dvorak_Righthanded-mac.ts +53 -0
- package/src/core/keyboard/layouts/en-Dvorak_Righthanded-pc.json +1 -0
- package/src/core/keyboard/layouts/en-Dvorak_Righthanded-pc.ts +55 -0
- package/src/core/keyboard/layouts/en-US-mac.json +1 -0
- package/src/core/keyboard/layouts/en-US-mac.ts +53 -0
- package/src/core/keyboard/layouts/en-US-pc.json +1 -0
- package/src/core/keyboard/layouts/en-US-pc.ts +55 -0
- package/src/core/keyboard/layouts/es-Spanish-mac.json +1 -0
- package/src/core/keyboard/layouts/es-Spanish-mac.ts +53 -0
- package/src/core/keyboard/layouts/es-Spanish-pc.json +1 -0
- package/src/core/keyboard/layouts/es-Spanish-pc.ts +55 -0
- package/src/core/keyboard/layouts/fr-Bepo-pc.json +1 -0
- package/src/core/keyboard/layouts/fr-Bepo-pc.ts +289 -0
- package/src/core/keyboard/layouts/fr-Canadian_French-mac.json +1 -0
- package/src/core/keyboard/layouts/fr-Canadian_French-mac.ts +53 -0
- package/src/core/keyboard/layouts/fr-Canadian_French-pc.json +1 -0
- package/src/core/keyboard/layouts/fr-Canadian_French-pc.ts +55 -0
- package/src/core/keyboard/layouts/fr-French-mac.json +1 -0
- package/src/core/keyboard/layouts/fr-French-mac.ts +53 -0
- package/src/core/keyboard/layouts/fr-French-pc.json +1 -0
- package/src/core/keyboard/layouts/fr-French-pc.ts +55 -0
- package/src/core/keyboard/layouts/fr-Swiss_French-mac.json +1 -0
- package/src/core/keyboard/layouts/fr-Swiss_French-mac.ts +53 -0
- package/src/core/keyboard/layouts/fr-Swiss_French-pc.json +1 -0
- package/src/core/keyboard/layouts/fr-Swiss_French-pc.ts +55 -0
- package/src/core/keyboard/layouts/hu-Hungarian-mac.json +1 -0
- package/src/core/keyboard/layouts/hu-Hungarian-mac.ts +53 -0
- package/src/core/keyboard/layouts/hu-Hungarian-pc.json +1 -0
- package/src/core/keyboard/layouts/hu-Hungarian-pc.ts +55 -0
- package/src/core/keyboard/layouts/index.ts +59 -0
- package/src/core/keyboard/layouts/it-Italian-mac.json +1 -0
- package/src/core/keyboard/layouts/it-Italian-mac.ts +53 -0
- package/src/core/keyboard/layouts/it-Italian-pc.json +1 -0
- package/src/core/keyboard/layouts/it-Italian-pc.ts +67 -0
- package/src/core/keyboard/layouts/nb-Norwegian-mac.json +1 -0
- package/src/core/keyboard/layouts/nb-Norwegian-mac.ts +53 -0
- package/src/core/keyboard/layouts/nb-Norwegian-pc.json +1 -0
- package/src/core/keyboard/layouts/nb-Norwegian-pc.ts +55 -0
- package/src/core/keyboard/layouts/nl-Dutch-mac.json +1 -0
- package/src/core/keyboard/layouts/nl-Dutch-mac.ts +53 -0
- package/src/core/keyboard/layouts/nl-Dutch-pc.json +1 -0
- package/src/core/keyboard/layouts/nl-Dutch-pc.ts +55 -0
- package/src/core/keyboard/layouts/pl-Polish-mac.json +1 -0
- package/src/core/keyboard/layouts/pl-Polish-mac.ts +53 -0
- package/src/core/keyboard/layouts/pl-Polish-pc.json +1 -0
- package/src/core/keyboard/layouts/pl-Polish-pc.ts +55 -0
- package/src/core/keyboard/layouts/pt-Brazilian-mac.json +1 -0
- package/src/core/keyboard/layouts/pt-Brazilian-mac.ts +53 -0
- package/src/core/keyboard/layouts/pt-Portuguese-mac.json +1 -0
- package/src/core/keyboard/layouts/pt-Portuguese-mac.ts +53 -0
- package/src/core/keyboard/layouts/pt-Portuguese-pc.json +65 -0
- package/src/core/keyboard/layouts/pt-Portuguese-pc.ts +55 -0
- package/src/core/keyboard/layouts/ro-Romanian-mac.json +1 -0
- package/src/core/keyboard/layouts/ro-Romanian-mac.ts +53 -0
- package/src/core/keyboard/layouts/ro-Romanian-pc.json +1 -0
- package/src/core/keyboard/layouts/ro-Romanian-pc.ts +127 -0
- package/src/core/keyboard/layouts/sv-Swedish-mac.json +1 -0
- package/src/core/keyboard/layouts/sv-Swedish-mac.ts +53 -0
- package/src/core/keyboard/layouts/sv-Swedish-pc.json +1 -0
- package/src/core/keyboard/layouts/sv-Swedish-pc.ts +55 -0
- package/src/core/keyboard/layouts/tr-Turkish_Q-mac.json +1 -0
- package/src/core/keyboard/layouts/tr-Turkish_Q-mac.ts +53 -0
- package/src/core/keyboard/layouts/tr-Turkish_Q-pc.json +1 -0
- package/src/core/keyboard/layouts/tr-Turkish_Q-pc.ts +67 -0
- package/src/core/menu/default-menu-node.ts +210 -0
- package/src/core/menu/index.ts +39 -0
- package/src/core/menu/menu-protocol.ts +142 -0
- package/src/core/menu/menu-registry.ts +271 -0
- package/src/core/menu/module.ts +32 -0
- package/src/core/module/index.ts +3 -0
- package/src/core/module/mana-module-context.ts +40 -0
- package/src/core/module/mana-module.test.ts +161 -0
- package/src/core/module/mana-module.ts +44 -0
- package/src/core/module/module-protocol.ts +12 -0
- package/src/core/nls.ts +46 -0
- package/src/core/selection/index.ts +7 -0
- package/src/core/selection/selection-service.ts +26 -0
- package/src/core/theme/base-variable-registry.ts +132 -0
- package/src/core/theme/basic/antd-variable-contribution.ts +849 -0
- package/src/core/theme/basic/default-variable-contribution.ts +163 -0
- package/src/core/theme/basic/index.spec.ts +16 -0
- package/src/core/theme/basic/index.ts +2 -0
- package/src/core/theme/basic/variable-protocol.ts +8 -0
- package/src/core/theme/basic/variable-registry.ts +23 -0
- package/src/core/theme/color/antd-color-contribution.ts +994 -0
- package/src/core/theme/color/color-protocol.ts +12 -0
- package/src/core/theme/color/color-registry.ts +140 -0
- package/src/core/theme/color/color.ts +695 -0
- package/src/core/theme/color/default-color-contribution.ts +502 -0
- package/src/core/theme/color/index.spec.ts +33 -0
- package/src/core/theme/color/index.ts +2 -0
- package/src/core/theme/index.spec.ts +17 -0
- package/src/core/theme/index.ts +37 -0
- package/src/core/theme/protocol.ts +19 -0
- package/src/core/theme/style/mana-logo.png +0 -0
- package/src/core/theme/style/theme-base.less +3 -0
- package/src/core/theme/theme-app.ts +80 -0
- package/src/core/theme/theme-service.ts +170 -0
- package/src/core/toolbar/default-toolbar-item.ts +80 -0
- package/src/core/toolbar/index.ts +23 -0
- package/src/core/toolbar/toolbar-protocol.ts +112 -0
- package/src/core/toolbar/toolbar-registry.ts +77 -0
- package/src/core/typings/native-keymap.d.ts +72 -0
- package/src/core/utils/hooks.ts +108 -0
- package/src/core/utils/index.ts +3 -0
- package/src/core/utils/lifecycle.ts +335 -0
- package/src/core/utils/map.ts +1020 -0
- package/src/core/view/decorator.ts +87 -0
- package/src/core/view/default-slot-view.tsx +231 -0
- package/src/core/view/default-view.tsx +70 -0
- package/src/core/view/focus-tracker.ts +363 -0
- package/src/core/view/hooks.tsx +40 -0
- package/src/core/view/index.less +4 -0
- package/src/core/view/index.ts +22 -0
- package/src/core/view/module.ts +41 -0
- package/src/core/view/navigatable-types.ts +49 -0
- package/src/core/view/navigatable.ts +29 -0
- package/src/core/view/open-handler.ts +122 -0
- package/src/core/view/portal-slot-view.tsx +107 -0
- package/src/core/view/root-view.tsx +102 -0
- package/src/core/view/saveable.ts +146 -0
- package/src/core/view/slot-view-manager.ts +199 -0
- package/src/core/view/slot.tsx +68 -0
- package/src/core/view/stateful-view.ts +22 -0
- package/src/core/view/title.tsx +24 -0
- package/src/core/view/utils.tsx +48 -0
- package/src/core/view/view-application.ts +70 -0
- package/src/core/view/view-container.tsx +91 -0
- package/src/core/view/view-context.tsx +37 -0
- package/src/core/view/view-decoration.ts +160 -0
- package/src/core/view/view-manager.ts +271 -0
- package/src/core/view/view-meta.ts +24 -0
- package/src/core/view/view-open-handler.ts +139 -0
- package/src/core/view/view-protocol.ts +218 -0
- package/src/core/view/view-render.tsx +39 -0
- package/src/core/view/view-storage.ts +218 -0
- package/src/index.ts +1 -0
- package/src/ioc/container-api.ts +22 -0
- package/src/ioc/container.spec.ts +291 -0
- package/src/ioc/container.ts +171 -0
- package/src/ioc/contribution/contribution-protocol.ts +27 -0
- package/src/ioc/contribution/contribution-provider.ts +73 -0
- package/src/ioc/contribution/contribution-register.ts +32 -0
- package/src/ioc/contribution/decorator.ts +16 -0
- package/src/ioc/contribution/index.spec.ts +174 -0
- package/src/ioc/contribution/index.ts +13 -0
- package/src/ioc/core.ts +198 -0
- package/src/ioc/decorator.spec.ts +43 -0
- package/src/ioc/decorator.ts +54 -0
- package/src/ioc/features/auto-factory.spec.ts +90 -0
- package/src/ioc/features/auto-factory.ts +44 -0
- package/src/ioc/features/prioritized-contribution.ts +43 -0
- package/src/ioc/index.ts +8 -0
- package/src/ioc/inversify-api/index.spec.ts +224 -0
- package/src/ioc/inversify-api/index.ts +76 -0
- package/src/ioc/inversify-api/inversify-protocol.ts +31 -0
- package/src/ioc/module/index.spec.ts +68 -0
- package/src/ioc/module/index.ts +7 -0
- package/src/ioc/module/syringe-module.ts +95 -0
- package/src/ioc/register.spec.ts +75 -0
- package/src/ioc/register.ts +210 -0
- package/src/ioc/side-option.spec.ts +39 -0
- package/src/ioc/side-option.ts +14 -0
- package/src/l10n/index.ts +2 -0
- package/src/l10n/l10n/index.test.ts +145 -0
- package/src/l10n/l10n/index.ts +319 -0
- package/src/l10n/l10n/platform.ts +51 -0
- package/src/l10n/lang/bundle.l10n.en-US.json +5 -0
- package/src/l10n/lang/bundle.l10n.zh-CN.json +5 -0
- package/src/l10n/lang/index.ts +9 -0
- package/src/observable/async-event.spec.tsx +64 -0
- package/src/observable/async-event.ts +110 -0
- package/src/observable/async.spec.tsx +142 -0
- package/src/observable/config.spec.ts +12 -0
- package/src/observable/config.ts +26 -0
- package/src/observable/context.spec.tsx +360 -0
- package/src/observable/context.tsx +39 -0
- package/src/observable/core.ts +28 -0
- package/src/observable/decorator.spec.ts +41 -0
- package/src/observable/decorator.ts +19 -0
- package/src/observable/hooks.spec.tsx +244 -0
- package/src/observable/hooks.ts +39 -0
- package/src/observable/index.ts +11 -0
- package/src/observable/notifiable.spec.ts +205 -0
- package/src/observable/notifiable.ts +185 -0
- package/src/observable/notifier.spec.ts +141 -0
- package/src/observable/notifier.ts +126 -0
- package/src/observable/observable.spec.ts +265 -0
- package/src/observable/observable.ts +87 -0
- package/src/observable/tracker.spec.ts +697 -0
- package/src/observable/tracker.ts +240 -0
- package/src/observable/utils.spec.tsx +93 -0
- package/src/observable/utils.ts +160 -0
- package/src/observable/watch.spec.ts +112 -0
- package/src/observable/watch.ts +77 -0
- package/src/polling/poll.ts +2 -2
- package/src/polling/protocol.ts +1 -1
- package/src/protocol/cell-protocol.ts +1 -1
- package/src/react/constant.ts +1 -0
- package/src/react/dropdown/index.tsx +86 -0
- package/src/react/dropdown/styles/index.less +121 -0
- package/src/react/index.spec.ts +13 -0
- package/src/react/index.ts +8 -0
- package/src/react/layout/boxpanel/Pane.tsx +51 -0
- package/src/react/layout/boxpanel/context.ts +11 -0
- package/src/react/layout/boxpanel/index.tsx +65 -0
- package/src/react/layout/boxpanel/styles/index.less +14 -0
- package/src/react/layout/layout.ts +85 -0
- package/src/react/layout/splitpanel/context.ts +35 -0
- package/src/react/layout/splitpanel/index.tsx +325 -0
- package/src/react/layout/splitpanel/pane.tsx +19 -0
- package/src/react/layout/splitpanel/styles/index.less +10 -0
- package/src/react/menu/context.tsx +10 -0
- package/src/react/menu/divider.tsx +9 -0
- package/src/react/menu/index.ts +3 -0
- package/src/react/menu/item.tsx +83 -0
- package/src/react/menu/menu.tsx +46 -0
- package/src/react/menu/styles/index.less +163 -0
- package/src/react/menu/submenu.tsx +28 -0
- package/src/react/menubar/context.tsx +17 -0
- package/src/react/menubar/index.ts +1 -0
- package/src/react/menubar/item.tsx +103 -0
- package/src/react/menubar/menubar.tsx +123 -0
- package/src/react/menubar/styles/index.less +113 -0
- package/src/react/notification/index.tsx +208 -0
- package/src/react/notification/protocol.ts +138 -0
- package/src/react/notification/pure-panel.tsx +119 -0
- package/src/react/notification/render.ts +92 -0
- package/src/react/notification/style/index.less +192 -0
- package/src/react/notification/style/index.tsx +1 -0
- package/src/react/notification/style/placement.less +68 -0
- package/src/react/notification/use-notification.tsx +186 -0
- package/src/react/resize/index.tsx +769 -0
- package/src/react/resize/styles/index.less +83 -0
- package/src/react/styles/variables.less +2 -0
- package/src/react/tabs/index.tsx +75 -0
- package/src/react/tabs/styles/card.less +111 -0
- package/src/react/tabs/styles/dropdown.less +70 -0
- package/src/react/tabs/styles/index.less +231 -0
- package/src/react/tabs/styles/position.less +217 -0
- package/src/react/typings/index.d.ts +5 -0
- package/src/react/util.ts +5 -0
- package/src/url.ts +1 -1
|
@@ -0,0 +1,1509 @@
|
|
|
1
|
+
/* eslint-disable no-fallthrough */
|
|
2
|
+
/* eslint-disable no-case-declarations */
|
|
3
|
+
/*---------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
6
|
+
*--------------------------------------------------------------------------------------------*/
|
|
7
|
+
|
|
8
|
+
export enum ScanError {
|
|
9
|
+
None = 0,
|
|
10
|
+
UnexpectedEndOfComment = 1,
|
|
11
|
+
UnexpectedEndOfString = 2,
|
|
12
|
+
UnexpectedEndOfNumber = 3,
|
|
13
|
+
InvalidUnicode = 4,
|
|
14
|
+
InvalidEscapeCharacter = 5,
|
|
15
|
+
InvalidCharacter = 6,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export enum SyntaxKind {
|
|
19
|
+
OpenBraceToken = 1,
|
|
20
|
+
CloseBraceToken = 2,
|
|
21
|
+
OpenBracketToken = 3,
|
|
22
|
+
CloseBracketToken = 4,
|
|
23
|
+
CommaToken = 5,
|
|
24
|
+
ColonToken = 6,
|
|
25
|
+
NullKeyword = 7,
|
|
26
|
+
TrueKeyword = 8,
|
|
27
|
+
FalseKeyword = 9,
|
|
28
|
+
StringLiteral = 10,
|
|
29
|
+
NumericLiteral = 11,
|
|
30
|
+
LineCommentTrivia = 12,
|
|
31
|
+
BlockCommentTrivia = 13,
|
|
32
|
+
LineBreakTrivia = 14,
|
|
33
|
+
Trivia = 15,
|
|
34
|
+
Unknown = 16,
|
|
35
|
+
EOF = 17,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The scanner object, representing a JSON scanner at a position in the input string.
|
|
40
|
+
*/
|
|
41
|
+
export interface JSONScanner {
|
|
42
|
+
/**
|
|
43
|
+
* Sets the scan position to a new offset. A call to 'scan' is needed to get the first token.
|
|
44
|
+
*/
|
|
45
|
+
setPosition: (pos: number) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Read the next token. Returns the token code.
|
|
48
|
+
*/
|
|
49
|
+
scan: () => SyntaxKind;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the current scan position, which is after the last read token.
|
|
52
|
+
*/
|
|
53
|
+
getPosition: () => number;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the last read token.
|
|
56
|
+
*/
|
|
57
|
+
getToken: () => SyntaxKind;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the last read token value. The value for strings is the decoded string content. For numbers its of type number, for boolean it's true or false.
|
|
60
|
+
*/
|
|
61
|
+
getTokenValue: () => string;
|
|
62
|
+
/**
|
|
63
|
+
* The start offset of the last read token.
|
|
64
|
+
*/
|
|
65
|
+
getTokenOffset: () => number;
|
|
66
|
+
/**
|
|
67
|
+
* The length of the last read token.
|
|
68
|
+
*/
|
|
69
|
+
getTokenLength: () => number;
|
|
70
|
+
/**
|
|
71
|
+
* An error code of the last scan.
|
|
72
|
+
*/
|
|
73
|
+
getTokenError: () => ScanError;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ParseError {
|
|
77
|
+
error: ParseErrorCode;
|
|
78
|
+
offset: number;
|
|
79
|
+
length: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export enum ParseErrorCode {
|
|
83
|
+
InvalidSymbol = 1,
|
|
84
|
+
InvalidNumberFormat = 2,
|
|
85
|
+
PropertyNameExpected = 3,
|
|
86
|
+
ValueExpected = 4,
|
|
87
|
+
ColonExpected = 5,
|
|
88
|
+
CommaExpected = 6,
|
|
89
|
+
CloseBraceExpected = 7,
|
|
90
|
+
CloseBracketExpected = 8,
|
|
91
|
+
EndOfFileExpected = 9,
|
|
92
|
+
InvalidCommentToken = 10,
|
|
93
|
+
UnexpectedEndOfComment = 11,
|
|
94
|
+
UnexpectedEndOfString = 12,
|
|
95
|
+
UnexpectedEndOfNumber = 13,
|
|
96
|
+
InvalidUnicode = 14,
|
|
97
|
+
InvalidEscapeCharacter = 15,
|
|
98
|
+
InvalidCharacter = 16,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type NodeType =
|
|
102
|
+
| 'object'
|
|
103
|
+
| 'array'
|
|
104
|
+
| 'property'
|
|
105
|
+
| 'string'
|
|
106
|
+
| 'number'
|
|
107
|
+
| 'boolean'
|
|
108
|
+
| 'null';
|
|
109
|
+
|
|
110
|
+
export interface Node {
|
|
111
|
+
readonly type: NodeType;
|
|
112
|
+
readonly value?: any | undefined;
|
|
113
|
+
readonly offset: number;
|
|
114
|
+
readonly length: number;
|
|
115
|
+
readonly colonOffset?: number | undefined;
|
|
116
|
+
readonly parent?: Node | undefined;
|
|
117
|
+
readonly children?: Node[] | undefined;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type Segment = string | number;
|
|
121
|
+
export type JSONPath = Segment[];
|
|
122
|
+
|
|
123
|
+
export interface Location {
|
|
124
|
+
/**
|
|
125
|
+
* The previous property key or literal value (string, number, boolean or null) or undefined.
|
|
126
|
+
*/
|
|
127
|
+
previousNode?: Node | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The path describing the location in the JSON document. The path consists of a sequence strings
|
|
130
|
+
* representing an object property or numbers for array indices.
|
|
131
|
+
*/
|
|
132
|
+
path: JSONPath;
|
|
133
|
+
/**
|
|
134
|
+
* Matches the locations path against a pattern consisting of strings (for properties) and numbers (for array indices).
|
|
135
|
+
* '*' will match a single segment, of any property name or index.
|
|
136
|
+
* '**' will match a sequence of segments or no segment, of any property name or index.
|
|
137
|
+
*/
|
|
138
|
+
matches: (patterns: JSONPath) => boolean;
|
|
139
|
+
/**
|
|
140
|
+
* If set, the location's offset is at a property key.
|
|
141
|
+
*/
|
|
142
|
+
isAtPropertyKey: boolean;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface ParseOptions {
|
|
146
|
+
disallowComments?: boolean;
|
|
147
|
+
allowTrailingComma?: boolean;
|
|
148
|
+
allowEmptyContent?: boolean;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export namespace ParseOptions {
|
|
152
|
+
export const DEFAULT = {
|
|
153
|
+
allowTrailingComma: true,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface JSONVisitor {
|
|
158
|
+
/**
|
|
159
|
+
* Invoked when an open brace is encountered and an object is started. The offset and length represent the location of the open brace.
|
|
160
|
+
*/
|
|
161
|
+
onObjectBegin?: (offset: number, length: number) => void;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Invoked when a property is encountered. The offset and length represent the location of the property name.
|
|
165
|
+
*/
|
|
166
|
+
onObjectProperty?: (property: string, offset: number, length: number) => void;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Invoked when a closing brace is encountered and an object is completed. The offset and length represent the location of the closing brace.
|
|
170
|
+
*/
|
|
171
|
+
onObjectEnd?: (offset: number, length: number) => void;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Invoked when an open bracket is encountered. The offset and length represent the location of the open bracket.
|
|
175
|
+
*/
|
|
176
|
+
onArrayBegin?: (offset: number, length: number) => void;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Invoked when a closing bracket is encountered. The offset and length represent the location of the closing bracket.
|
|
180
|
+
*/
|
|
181
|
+
onArrayEnd?: (offset: number, length: number) => void;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Invoked when a literal value is encountered. The offset and length represent the location of the literal value.
|
|
185
|
+
*/
|
|
186
|
+
onLiteralValue?: (value: any, offset: number, length: number) => void;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Invoked when a comma or colon separator is encountered. The offset and length represent the location of the separator.
|
|
190
|
+
*/
|
|
191
|
+
onSeparator?: (character: string, offset: number, length: number) => void;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* When comments are allowed, invoked when a line or block comment is encountered. The offset and length represent the location of the comment.
|
|
195
|
+
*/
|
|
196
|
+
onComment?: (offset: number, length: number) => void;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Invoked on an error.
|
|
200
|
+
*/
|
|
201
|
+
onError?: (error: ParseErrorCode, offset: number, length: number) => void;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Creates a JSON scanner on the given text.
|
|
206
|
+
* If ignoreTrivia is set, whitespaces or comments are ignored.
|
|
207
|
+
*/
|
|
208
|
+
export function createScanner(text: string, ignoreTrivia = false): JSONScanner {
|
|
209
|
+
let pos = 0;
|
|
210
|
+
const len = text.length;
|
|
211
|
+
let value = '';
|
|
212
|
+
let tokenOffset = 0;
|
|
213
|
+
let token: SyntaxKind = SyntaxKind.Unknown;
|
|
214
|
+
let scanError: ScanError = ScanError.None;
|
|
215
|
+
|
|
216
|
+
function scanHexDigits(count: number): number {
|
|
217
|
+
let digits = 0;
|
|
218
|
+
let hexValue = 0;
|
|
219
|
+
while (digits < count) {
|
|
220
|
+
const ch = text.charCodeAt(pos);
|
|
221
|
+
if (ch >= CharacterCodes._0 && ch <= CharacterCodes._9) {
|
|
222
|
+
hexValue = hexValue * 16 + ch - CharacterCodes._0;
|
|
223
|
+
} else if (ch >= CharacterCodes.A && ch <= CharacterCodes.F) {
|
|
224
|
+
hexValue = hexValue * 16 + ch - CharacterCodes.A + 10;
|
|
225
|
+
} else if (ch >= CharacterCodes.a && ch <= CharacterCodes.f) {
|
|
226
|
+
hexValue = hexValue * 16 + ch - CharacterCodes.a + 10;
|
|
227
|
+
} else {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
pos++;
|
|
231
|
+
digits++;
|
|
232
|
+
}
|
|
233
|
+
if (digits < count) {
|
|
234
|
+
hexValue = -1;
|
|
235
|
+
}
|
|
236
|
+
return hexValue;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function setPosition(newPosition: number) {
|
|
240
|
+
pos = newPosition;
|
|
241
|
+
value = '';
|
|
242
|
+
tokenOffset = 0;
|
|
243
|
+
token = SyntaxKind.Unknown;
|
|
244
|
+
scanError = ScanError.None;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function scanNumber(): string {
|
|
248
|
+
const start = pos;
|
|
249
|
+
if (text.charCodeAt(pos) === CharacterCodes._0) {
|
|
250
|
+
pos++;
|
|
251
|
+
} else {
|
|
252
|
+
pos++;
|
|
253
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
254
|
+
pos++;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (pos < text.length && text.charCodeAt(pos) === CharacterCodes.dot) {
|
|
258
|
+
pos++;
|
|
259
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
260
|
+
pos++;
|
|
261
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
262
|
+
pos++;
|
|
263
|
+
}
|
|
264
|
+
} else {
|
|
265
|
+
scanError = ScanError.UnexpectedEndOfNumber;
|
|
266
|
+
return text.substring(start, pos);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
let end = pos;
|
|
270
|
+
if (
|
|
271
|
+
pos < text.length &&
|
|
272
|
+
(text.charCodeAt(pos) === CharacterCodes.E ||
|
|
273
|
+
text.charCodeAt(pos) === CharacterCodes.e)
|
|
274
|
+
) {
|
|
275
|
+
pos++;
|
|
276
|
+
if (
|
|
277
|
+
(pos < text.length && text.charCodeAt(pos) === CharacterCodes.plus) ||
|
|
278
|
+
text.charCodeAt(pos) === CharacterCodes.minus
|
|
279
|
+
) {
|
|
280
|
+
pos++;
|
|
281
|
+
}
|
|
282
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
283
|
+
pos++;
|
|
284
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
285
|
+
pos++;
|
|
286
|
+
}
|
|
287
|
+
end = pos;
|
|
288
|
+
} else {
|
|
289
|
+
scanError = ScanError.UnexpectedEndOfNumber;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return text.substring(start, end);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function scanString(): string {
|
|
296
|
+
let result = '';
|
|
297
|
+
let start = pos;
|
|
298
|
+
|
|
299
|
+
// eslint-disable-next-line no-constant-condition
|
|
300
|
+
while (true) {
|
|
301
|
+
if (pos >= len) {
|
|
302
|
+
result += text.substring(start, pos);
|
|
303
|
+
scanError = ScanError.UnexpectedEndOfString;
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
const ch = text.charCodeAt(pos);
|
|
307
|
+
if (ch === CharacterCodes.doubleQuote) {
|
|
308
|
+
result += text.substring(start, pos);
|
|
309
|
+
pos++;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
if (ch === CharacterCodes.backslash) {
|
|
313
|
+
result += text.substring(start, pos);
|
|
314
|
+
pos++;
|
|
315
|
+
if (pos >= len) {
|
|
316
|
+
scanError = ScanError.UnexpectedEndOfString;
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
const ch2 = text.charCodeAt(pos++);
|
|
320
|
+
switch (ch2) {
|
|
321
|
+
case CharacterCodes.doubleQuote:
|
|
322
|
+
result += '"';
|
|
323
|
+
break;
|
|
324
|
+
case CharacterCodes.backslash:
|
|
325
|
+
result += '\\';
|
|
326
|
+
break;
|
|
327
|
+
case CharacterCodes.slash:
|
|
328
|
+
result += '/';
|
|
329
|
+
break;
|
|
330
|
+
case CharacterCodes.b:
|
|
331
|
+
result += '\b';
|
|
332
|
+
break;
|
|
333
|
+
case CharacterCodes.f:
|
|
334
|
+
result += '\f';
|
|
335
|
+
break;
|
|
336
|
+
case CharacterCodes.n:
|
|
337
|
+
result += '\n';
|
|
338
|
+
break;
|
|
339
|
+
case CharacterCodes.r:
|
|
340
|
+
result += '\r';
|
|
341
|
+
break;
|
|
342
|
+
case CharacterCodes.t:
|
|
343
|
+
result += '\t';
|
|
344
|
+
break;
|
|
345
|
+
case CharacterCodes.u:
|
|
346
|
+
const ch3 = scanHexDigits(4);
|
|
347
|
+
if (ch3 >= 0) {
|
|
348
|
+
result += String.fromCharCode(ch3);
|
|
349
|
+
} else {
|
|
350
|
+
scanError = ScanError.InvalidUnicode;
|
|
351
|
+
}
|
|
352
|
+
break;
|
|
353
|
+
default:
|
|
354
|
+
scanError = ScanError.InvalidEscapeCharacter;
|
|
355
|
+
}
|
|
356
|
+
start = pos;
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
if (ch >= 0 && ch <= 0x1f) {
|
|
360
|
+
if (isLineBreak(ch)) {
|
|
361
|
+
result += text.substring(start, pos);
|
|
362
|
+
scanError = ScanError.UnexpectedEndOfString;
|
|
363
|
+
break;
|
|
364
|
+
} else {
|
|
365
|
+
scanError = ScanError.InvalidCharacter;
|
|
366
|
+
// mark as error but continue with string
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
pos++;
|
|
370
|
+
}
|
|
371
|
+
return result;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function scanNext(): SyntaxKind {
|
|
375
|
+
value = '';
|
|
376
|
+
scanError = ScanError.None;
|
|
377
|
+
|
|
378
|
+
tokenOffset = pos;
|
|
379
|
+
|
|
380
|
+
if (pos >= len) {
|
|
381
|
+
// at the end
|
|
382
|
+
tokenOffset = len;
|
|
383
|
+
return (token = SyntaxKind.EOF);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
let code = text.charCodeAt(pos);
|
|
387
|
+
// trivia: whitespace
|
|
388
|
+
if (isWhitespace(code)) {
|
|
389
|
+
do {
|
|
390
|
+
pos++;
|
|
391
|
+
value += String.fromCharCode(code);
|
|
392
|
+
code = text.charCodeAt(pos);
|
|
393
|
+
} while (isWhitespace(code));
|
|
394
|
+
|
|
395
|
+
return (token = SyntaxKind.Trivia);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// trivia: newlines
|
|
399
|
+
if (isLineBreak(code)) {
|
|
400
|
+
pos++;
|
|
401
|
+
value += String.fromCharCode(code);
|
|
402
|
+
if (
|
|
403
|
+
code === CharacterCodes.carriageReturn &&
|
|
404
|
+
text.charCodeAt(pos) === CharacterCodes.lineFeed
|
|
405
|
+
) {
|
|
406
|
+
pos++;
|
|
407
|
+
value += '\n';
|
|
408
|
+
}
|
|
409
|
+
return (token = SyntaxKind.LineBreakTrivia);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
switch (code) {
|
|
413
|
+
// tokens: []{}:,
|
|
414
|
+
case CharacterCodes.openBrace:
|
|
415
|
+
pos++;
|
|
416
|
+
return (token = SyntaxKind.OpenBraceToken);
|
|
417
|
+
case CharacterCodes.closeBrace:
|
|
418
|
+
pos++;
|
|
419
|
+
return (token = SyntaxKind.CloseBraceToken);
|
|
420
|
+
case CharacterCodes.openBracket:
|
|
421
|
+
pos++;
|
|
422
|
+
return (token = SyntaxKind.OpenBracketToken);
|
|
423
|
+
case CharacterCodes.closeBracket:
|
|
424
|
+
pos++;
|
|
425
|
+
return (token = SyntaxKind.CloseBracketToken);
|
|
426
|
+
case CharacterCodes.colon:
|
|
427
|
+
pos++;
|
|
428
|
+
return (token = SyntaxKind.ColonToken);
|
|
429
|
+
case CharacterCodes.comma:
|
|
430
|
+
pos++;
|
|
431
|
+
return (token = SyntaxKind.CommaToken);
|
|
432
|
+
|
|
433
|
+
// strings
|
|
434
|
+
case CharacterCodes.doubleQuote:
|
|
435
|
+
pos++;
|
|
436
|
+
value = scanString();
|
|
437
|
+
return (token = SyntaxKind.StringLiteral);
|
|
438
|
+
|
|
439
|
+
// comments
|
|
440
|
+
case CharacterCodes.slash:
|
|
441
|
+
const start = pos - 1;
|
|
442
|
+
// Single-line comment
|
|
443
|
+
if (text.charCodeAt(pos + 1) === CharacterCodes.slash) {
|
|
444
|
+
pos += 2;
|
|
445
|
+
|
|
446
|
+
while (pos < len) {
|
|
447
|
+
if (isLineBreak(text.charCodeAt(pos))) {
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
pos++;
|
|
451
|
+
}
|
|
452
|
+
value = text.substring(start, pos);
|
|
453
|
+
return (token = SyntaxKind.LineCommentTrivia);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Multi-line comment
|
|
457
|
+
if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
|
|
458
|
+
pos += 2;
|
|
459
|
+
|
|
460
|
+
const safeLength = len - 1; // For lookahead.
|
|
461
|
+
let commentClosed = false;
|
|
462
|
+
while (pos < safeLength) {
|
|
463
|
+
const ch = text.charCodeAt(pos);
|
|
464
|
+
|
|
465
|
+
if (
|
|
466
|
+
ch === CharacterCodes.asterisk &&
|
|
467
|
+
text.charCodeAt(pos + 1) === CharacterCodes.slash
|
|
468
|
+
) {
|
|
469
|
+
pos += 2;
|
|
470
|
+
commentClosed = true;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
pos++;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (!commentClosed) {
|
|
477
|
+
pos++;
|
|
478
|
+
scanError = ScanError.UnexpectedEndOfComment;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
value = text.substring(start, pos);
|
|
482
|
+
return (token = SyntaxKind.BlockCommentTrivia);
|
|
483
|
+
}
|
|
484
|
+
// just a single slash
|
|
485
|
+
value += String.fromCharCode(code);
|
|
486
|
+
pos++;
|
|
487
|
+
return (token = SyntaxKind.Unknown);
|
|
488
|
+
|
|
489
|
+
// numbers
|
|
490
|
+
case CharacterCodes.minus:
|
|
491
|
+
value += String.fromCharCode(code);
|
|
492
|
+
pos++;
|
|
493
|
+
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
494
|
+
return (token = SyntaxKind.Unknown);
|
|
495
|
+
}
|
|
496
|
+
// found a minus, followed by a number so
|
|
497
|
+
// we fall through to proceed with scanning
|
|
498
|
+
// numbers
|
|
499
|
+
case CharacterCodes._0:
|
|
500
|
+
case CharacterCodes._1:
|
|
501
|
+
case CharacterCodes._2:
|
|
502
|
+
case CharacterCodes._3:
|
|
503
|
+
case CharacterCodes._4:
|
|
504
|
+
case CharacterCodes._5:
|
|
505
|
+
case CharacterCodes._6:
|
|
506
|
+
case CharacterCodes._7:
|
|
507
|
+
case CharacterCodes._8:
|
|
508
|
+
case CharacterCodes._9:
|
|
509
|
+
value += scanNumber();
|
|
510
|
+
return (token = SyntaxKind.NumericLiteral);
|
|
511
|
+
// literals and unknown symbols
|
|
512
|
+
default:
|
|
513
|
+
// is a literal? Read the full word.
|
|
514
|
+
while (pos < len && isUnknownContentCharacter(code)) {
|
|
515
|
+
pos++;
|
|
516
|
+
code = text.charCodeAt(pos);
|
|
517
|
+
}
|
|
518
|
+
if (tokenOffset !== pos) {
|
|
519
|
+
value = text.substring(tokenOffset, pos);
|
|
520
|
+
// keywords: true, false, null
|
|
521
|
+
switch (value) {
|
|
522
|
+
case 'true':
|
|
523
|
+
return (token = SyntaxKind.TrueKeyword);
|
|
524
|
+
case 'false':
|
|
525
|
+
return (token = SyntaxKind.FalseKeyword);
|
|
526
|
+
case 'null':
|
|
527
|
+
return (token = SyntaxKind.NullKeyword);
|
|
528
|
+
}
|
|
529
|
+
return (token = SyntaxKind.Unknown);
|
|
530
|
+
}
|
|
531
|
+
// some
|
|
532
|
+
value += String.fromCharCode(code);
|
|
533
|
+
pos++;
|
|
534
|
+
return (token = SyntaxKind.Unknown);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function isUnknownContentCharacter(code: CharacterCodes) {
|
|
539
|
+
if (isWhitespace(code) || isLineBreak(code)) {
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
543
|
+
switch (code) {
|
|
544
|
+
case CharacterCodes.closeBrace:
|
|
545
|
+
case CharacterCodes.closeBracket:
|
|
546
|
+
case CharacterCodes.openBrace:
|
|
547
|
+
case CharacterCodes.openBracket:
|
|
548
|
+
case CharacterCodes.doubleQuote:
|
|
549
|
+
case CharacterCodes.colon:
|
|
550
|
+
case CharacterCodes.comma:
|
|
551
|
+
case CharacterCodes.slash:
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function scanNextNonTrivia(): SyntaxKind {
|
|
558
|
+
let result: SyntaxKind;
|
|
559
|
+
do {
|
|
560
|
+
result = scanNext();
|
|
561
|
+
} while (result >= SyntaxKind.LineCommentTrivia && result <= SyntaxKind.Trivia);
|
|
562
|
+
return result;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
return {
|
|
566
|
+
setPosition,
|
|
567
|
+
getPosition: () => pos,
|
|
568
|
+
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
569
|
+
getToken: () => token,
|
|
570
|
+
getTokenValue: () => value,
|
|
571
|
+
getTokenOffset: () => tokenOffset,
|
|
572
|
+
getTokenLength: () => pos - tokenOffset,
|
|
573
|
+
getTokenError: () => scanError,
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
function isWhitespace(ch: number): boolean {
|
|
578
|
+
return (
|
|
579
|
+
ch === CharacterCodes.space ||
|
|
580
|
+
ch === CharacterCodes.tab ||
|
|
581
|
+
ch === CharacterCodes.verticalTab ||
|
|
582
|
+
ch === CharacterCodes.formFeed ||
|
|
583
|
+
ch === CharacterCodes.nonBreakingSpace ||
|
|
584
|
+
ch === CharacterCodes.ogham ||
|
|
585
|
+
(ch >= CharacterCodes.enQuad && ch <= CharacterCodes.zeroWidthSpace) ||
|
|
586
|
+
ch === CharacterCodes.narrowNoBreakSpace ||
|
|
587
|
+
ch === CharacterCodes.mathematicalSpace ||
|
|
588
|
+
ch === CharacterCodes.ideographicSpace ||
|
|
589
|
+
ch === CharacterCodes.byteOrderMark
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function isLineBreak(ch: number): boolean {
|
|
594
|
+
return (
|
|
595
|
+
ch === CharacterCodes.lineFeed ||
|
|
596
|
+
ch === CharacterCodes.carriageReturn ||
|
|
597
|
+
ch === CharacterCodes.lineSeparator ||
|
|
598
|
+
ch === CharacterCodes.paragraphSeparator
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
function isDigit(ch: number): boolean {
|
|
603
|
+
return ch >= CharacterCodes._0 && ch <= CharacterCodes._9;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
enum CharacterCodes {
|
|
607
|
+
nullCharacter = 0,
|
|
608
|
+
maxAsciiCharacter = 0x7f,
|
|
609
|
+
|
|
610
|
+
lineFeed = 0x0a, // \n
|
|
611
|
+
carriageReturn = 0x0d, // \r
|
|
612
|
+
lineSeparator = 0x2028,
|
|
613
|
+
paragraphSeparator = 0x2029,
|
|
614
|
+
|
|
615
|
+
// REVIEW: do we need to support this? The scanner doesn't, but our IText does. This seems
|
|
616
|
+
// like an odd disparity? (Or maybe it's completely fine for them to be different).
|
|
617
|
+
nextLine = 0x0085,
|
|
618
|
+
|
|
619
|
+
// Unicode 3.0 space characters
|
|
620
|
+
space = 0x0020, // " "
|
|
621
|
+
nonBreakingSpace = 0x00a0, //
|
|
622
|
+
enQuad = 0x2000,
|
|
623
|
+
emQuad = 0x2001,
|
|
624
|
+
enSpace = 0x2002,
|
|
625
|
+
emSpace = 0x2003,
|
|
626
|
+
threePerEmSpace = 0x2004,
|
|
627
|
+
fourPerEmSpace = 0x2005,
|
|
628
|
+
sixPerEmSpace = 0x2006,
|
|
629
|
+
figureSpace = 0x2007,
|
|
630
|
+
punctuationSpace = 0x2008,
|
|
631
|
+
thinSpace = 0x2009,
|
|
632
|
+
hairSpace = 0x200a,
|
|
633
|
+
zeroWidthSpace = 0x200b,
|
|
634
|
+
narrowNoBreakSpace = 0x202f,
|
|
635
|
+
ideographicSpace = 0x3000,
|
|
636
|
+
mathematicalSpace = 0x205f,
|
|
637
|
+
ogham = 0x1680,
|
|
638
|
+
|
|
639
|
+
_ = 0x5f,
|
|
640
|
+
$ = 0x24,
|
|
641
|
+
|
|
642
|
+
_0 = 0x30,
|
|
643
|
+
_1 = 0x31,
|
|
644
|
+
_2 = 0x32,
|
|
645
|
+
_3 = 0x33,
|
|
646
|
+
_4 = 0x34,
|
|
647
|
+
_5 = 0x35,
|
|
648
|
+
_6 = 0x36,
|
|
649
|
+
_7 = 0x37,
|
|
650
|
+
_8 = 0x38,
|
|
651
|
+
_9 = 0x39,
|
|
652
|
+
|
|
653
|
+
a = 0x61,
|
|
654
|
+
b = 0x62,
|
|
655
|
+
c = 0x63,
|
|
656
|
+
d = 0x64,
|
|
657
|
+
e = 0x65,
|
|
658
|
+
f = 0x66,
|
|
659
|
+
g = 0x67,
|
|
660
|
+
h = 0x68,
|
|
661
|
+
i = 0x69,
|
|
662
|
+
j = 0x6a,
|
|
663
|
+
k = 0x6b,
|
|
664
|
+
l = 0x6c,
|
|
665
|
+
m = 0x6d,
|
|
666
|
+
n = 0x6e,
|
|
667
|
+
o = 0x6f,
|
|
668
|
+
p = 0x70,
|
|
669
|
+
q = 0x71,
|
|
670
|
+
r = 0x72,
|
|
671
|
+
s = 0x73,
|
|
672
|
+
t = 0x74,
|
|
673
|
+
u = 0x75,
|
|
674
|
+
v = 0x76,
|
|
675
|
+
w = 0x77,
|
|
676
|
+
x = 0x78,
|
|
677
|
+
y = 0x79,
|
|
678
|
+
z = 0x7a,
|
|
679
|
+
|
|
680
|
+
A = 0x41,
|
|
681
|
+
B = 0x42,
|
|
682
|
+
C = 0x43,
|
|
683
|
+
D = 0x44,
|
|
684
|
+
E = 0x45,
|
|
685
|
+
F = 0x46,
|
|
686
|
+
G = 0x47,
|
|
687
|
+
H = 0x48,
|
|
688
|
+
I = 0x49,
|
|
689
|
+
J = 0x4a,
|
|
690
|
+
K = 0x4b,
|
|
691
|
+
L = 0x4c,
|
|
692
|
+
M = 0x4d,
|
|
693
|
+
N = 0x4e,
|
|
694
|
+
O = 0x4f,
|
|
695
|
+
P = 0x50,
|
|
696
|
+
Q = 0x51,
|
|
697
|
+
R = 0x52,
|
|
698
|
+
S = 0x53,
|
|
699
|
+
T = 0x54,
|
|
700
|
+
U = 0x55,
|
|
701
|
+
V = 0x56,
|
|
702
|
+
W = 0x57,
|
|
703
|
+
X = 0x58,
|
|
704
|
+
Y = 0x59,
|
|
705
|
+
Z = 0x5a,
|
|
706
|
+
|
|
707
|
+
ampersand = 0x26, // &
|
|
708
|
+
asterisk = 0x2a, // *
|
|
709
|
+
at = 0x40, // @
|
|
710
|
+
backslash = 0x5c, // \
|
|
711
|
+
bar = 0x7c, // |
|
|
712
|
+
caret = 0x5e, // ^
|
|
713
|
+
closeBrace = 0x7d, // }
|
|
714
|
+
closeBracket = 0x5d, // ]
|
|
715
|
+
closeParen = 0x29, // )
|
|
716
|
+
colon = 0x3a, // :
|
|
717
|
+
comma = 0x2c, // ,
|
|
718
|
+
dot = 0x2e, // .
|
|
719
|
+
doubleQuote = 0x22, // "
|
|
720
|
+
equals = 0x3d, // =
|
|
721
|
+
exclamation = 0x21, // !
|
|
722
|
+
greaterThan = 0x3e, // >
|
|
723
|
+
lessThan = 0x3c, // <
|
|
724
|
+
minus = 0x2d, // -
|
|
725
|
+
openBrace = 0x7b, // {
|
|
726
|
+
openBracket = 0x5b, // [
|
|
727
|
+
openParen = 0x28, // (
|
|
728
|
+
percent = 0x25, // %
|
|
729
|
+
plus = 0x2b, // +
|
|
730
|
+
question = 0x3f, // ?
|
|
731
|
+
semicolon = 0x3b, // ;
|
|
732
|
+
singleQuote = 0x27, // '
|
|
733
|
+
slash = 0x2f, // /
|
|
734
|
+
tilde = 0x7e, // ~
|
|
735
|
+
|
|
736
|
+
backspace = 0x08, // \b
|
|
737
|
+
formFeed = 0x0c, // \f
|
|
738
|
+
byteOrderMark = 0xfeff,
|
|
739
|
+
tab = 0x09, // \t
|
|
740
|
+
verticalTab = 0x0b, // \v
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
interface NodeImpl extends Node {
|
|
744
|
+
type: NodeType;
|
|
745
|
+
value?: any | undefined;
|
|
746
|
+
offset: number;
|
|
747
|
+
length: number;
|
|
748
|
+
colonOffset?: number | undefined;
|
|
749
|
+
parent?: NodeImpl | undefined;
|
|
750
|
+
children?: NodeImpl[] | undefined;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
/**
|
|
754
|
+
* For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.
|
|
755
|
+
*/
|
|
756
|
+
export function getLocation(text: string, position: number): Location {
|
|
757
|
+
const segments: Segment[] = []; // strings or numbers
|
|
758
|
+
// eslint-disable-next-line no-new-object
|
|
759
|
+
const earlyReturnException = new Object();
|
|
760
|
+
let previousNode: NodeImpl | undefined;
|
|
761
|
+
const previousNodeInst: NodeImpl = {
|
|
762
|
+
value: {},
|
|
763
|
+
offset: 0,
|
|
764
|
+
length: 0,
|
|
765
|
+
type: 'object',
|
|
766
|
+
parent: undefined,
|
|
767
|
+
};
|
|
768
|
+
let isAtPropertyKey = false;
|
|
769
|
+
function setPreviousNode(
|
|
770
|
+
value: string,
|
|
771
|
+
offset: number,
|
|
772
|
+
length: number,
|
|
773
|
+
type: NodeType,
|
|
774
|
+
) {
|
|
775
|
+
previousNodeInst.value = value;
|
|
776
|
+
previousNodeInst.offset = offset;
|
|
777
|
+
previousNodeInst.length = length;
|
|
778
|
+
previousNodeInst.type = type;
|
|
779
|
+
previousNodeInst.colonOffset = undefined;
|
|
780
|
+
previousNode = previousNodeInst;
|
|
781
|
+
}
|
|
782
|
+
try {
|
|
783
|
+
visit(text, {
|
|
784
|
+
onObjectBegin: (offset: number, _length: number) => {
|
|
785
|
+
if (position <= offset) {
|
|
786
|
+
throw earlyReturnException;
|
|
787
|
+
}
|
|
788
|
+
previousNode = undefined;
|
|
789
|
+
isAtPropertyKey = position > offset;
|
|
790
|
+
segments.push(''); // push a placeholder (will be replaced)
|
|
791
|
+
},
|
|
792
|
+
onObjectProperty: (name: string, offset: number, length: number) => {
|
|
793
|
+
if (position < offset) {
|
|
794
|
+
throw earlyReturnException;
|
|
795
|
+
}
|
|
796
|
+
setPreviousNode(name, offset, length, 'property');
|
|
797
|
+
segments[segments.length - 1] = name;
|
|
798
|
+
if (position <= offset + length) {
|
|
799
|
+
throw earlyReturnException;
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
onObjectEnd: (offset: number, _length: number) => {
|
|
803
|
+
if (position <= offset) {
|
|
804
|
+
throw earlyReturnException;
|
|
805
|
+
}
|
|
806
|
+
previousNode = undefined;
|
|
807
|
+
segments.pop();
|
|
808
|
+
},
|
|
809
|
+
onArrayBegin: (offset: number, _length: number) => {
|
|
810
|
+
if (position <= offset) {
|
|
811
|
+
throw earlyReturnException;
|
|
812
|
+
}
|
|
813
|
+
previousNode = undefined;
|
|
814
|
+
segments.push(0);
|
|
815
|
+
},
|
|
816
|
+
onArrayEnd: (offset: number, _length: number) => {
|
|
817
|
+
if (position <= offset) {
|
|
818
|
+
throw earlyReturnException;
|
|
819
|
+
}
|
|
820
|
+
previousNode = undefined;
|
|
821
|
+
segments.pop();
|
|
822
|
+
},
|
|
823
|
+
onLiteralValue: (value: any, offset: number, length: number) => {
|
|
824
|
+
if (position < offset) {
|
|
825
|
+
throw earlyReturnException;
|
|
826
|
+
}
|
|
827
|
+
setPreviousNode(value, offset, length, getNodeType(value));
|
|
828
|
+
|
|
829
|
+
if (position <= offset + length) {
|
|
830
|
+
throw earlyReturnException;
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
onSeparator: (sep: string, offset: number, _length: number) => {
|
|
834
|
+
if (position <= offset) {
|
|
835
|
+
throw earlyReturnException;
|
|
836
|
+
}
|
|
837
|
+
if (sep === ':' && previousNode && previousNode.type === 'property') {
|
|
838
|
+
previousNode.colonOffset = offset;
|
|
839
|
+
isAtPropertyKey = false;
|
|
840
|
+
previousNode = undefined;
|
|
841
|
+
} else if (sep === ',') {
|
|
842
|
+
const last = segments[segments.length - 1];
|
|
843
|
+
if (typeof last === 'number') {
|
|
844
|
+
segments[segments.length - 1] = last + 1;
|
|
845
|
+
} else {
|
|
846
|
+
isAtPropertyKey = true;
|
|
847
|
+
segments[segments.length - 1] = '';
|
|
848
|
+
}
|
|
849
|
+
previousNode = undefined;
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
});
|
|
853
|
+
} catch (e) {
|
|
854
|
+
if (e !== earlyReturnException) {
|
|
855
|
+
throw e;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return {
|
|
860
|
+
path: segments,
|
|
861
|
+
previousNode,
|
|
862
|
+
isAtPropertyKey,
|
|
863
|
+
matches: (pattern: Segment[]) => {
|
|
864
|
+
let k = 0;
|
|
865
|
+
for (let i = 0; k < pattern.length && i < segments.length; i++) {
|
|
866
|
+
if (pattern[k] === segments[i] || pattern[k] === '*') {
|
|
867
|
+
k++;
|
|
868
|
+
} else if (pattern[k] !== '**') {
|
|
869
|
+
return false;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return k === pattern.length;
|
|
873
|
+
},
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
|
879
|
+
* Therefore always check the errors list to find out if the input was valid.
|
|
880
|
+
*/
|
|
881
|
+
export function parse(
|
|
882
|
+
text: string,
|
|
883
|
+
errors: ParseError[] = [],
|
|
884
|
+
options: ParseOptions = ParseOptions.DEFAULT,
|
|
885
|
+
): any {
|
|
886
|
+
let currentProperty: string | null = null;
|
|
887
|
+
let currentParent: any = [];
|
|
888
|
+
const previousParents: any[] = [];
|
|
889
|
+
|
|
890
|
+
function onValue(value: any) {
|
|
891
|
+
if (Array.isArray(currentParent)) {
|
|
892
|
+
(<any[]>currentParent).push(value);
|
|
893
|
+
} else if (currentProperty !== null) {
|
|
894
|
+
currentParent[currentProperty] = value;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
const visitor: JSONVisitor = {
|
|
899
|
+
onObjectBegin: () => {
|
|
900
|
+
const object = {};
|
|
901
|
+
onValue(object);
|
|
902
|
+
previousParents.push(currentParent);
|
|
903
|
+
currentParent = object;
|
|
904
|
+
currentProperty = null;
|
|
905
|
+
},
|
|
906
|
+
onObjectProperty: (name: string) => {
|
|
907
|
+
currentProperty = name;
|
|
908
|
+
},
|
|
909
|
+
onObjectEnd: () => {
|
|
910
|
+
currentParent = previousParents.pop();
|
|
911
|
+
},
|
|
912
|
+
onArrayBegin: () => {
|
|
913
|
+
const array: any[] = [];
|
|
914
|
+
onValue(array);
|
|
915
|
+
previousParents.push(currentParent);
|
|
916
|
+
currentParent = array;
|
|
917
|
+
currentProperty = null;
|
|
918
|
+
},
|
|
919
|
+
onArrayEnd: () => {
|
|
920
|
+
currentParent = previousParents.pop();
|
|
921
|
+
},
|
|
922
|
+
onLiteralValue: onValue,
|
|
923
|
+
onError: (error: ParseErrorCode, offset: number, length: number) => {
|
|
924
|
+
errors.push({ error, offset, length });
|
|
925
|
+
},
|
|
926
|
+
};
|
|
927
|
+
visit(text, visitor, options);
|
|
928
|
+
return currentParent[0];
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
|
933
|
+
*/
|
|
934
|
+
export function parseTree(
|
|
935
|
+
text: string,
|
|
936
|
+
errors: ParseError[] = [],
|
|
937
|
+
options: ParseOptions = ParseOptions.DEFAULT,
|
|
938
|
+
): Node {
|
|
939
|
+
let currentParent: NodeImpl = {
|
|
940
|
+
type: 'array',
|
|
941
|
+
offset: -1,
|
|
942
|
+
length: -1,
|
|
943
|
+
children: [],
|
|
944
|
+
parent: undefined,
|
|
945
|
+
}; // artificial root
|
|
946
|
+
|
|
947
|
+
function ensurePropertyComplete(endOffset: number) {
|
|
948
|
+
if (currentParent.type === 'property') {
|
|
949
|
+
currentParent.length = endOffset - currentParent.offset;
|
|
950
|
+
currentParent = currentParent.parent!;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
function onValue(valueNode: Node): Node {
|
|
955
|
+
currentParent.children!.push(valueNode);
|
|
956
|
+
return valueNode;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
const visitor: JSONVisitor = {
|
|
960
|
+
onObjectBegin: (offset: number) => {
|
|
961
|
+
currentParent = onValue({
|
|
962
|
+
type: 'object',
|
|
963
|
+
offset,
|
|
964
|
+
length: -1,
|
|
965
|
+
parent: currentParent,
|
|
966
|
+
children: [],
|
|
967
|
+
});
|
|
968
|
+
},
|
|
969
|
+
onObjectProperty: (name: string, offset: number, length: number) => {
|
|
970
|
+
currentParent = onValue({
|
|
971
|
+
type: 'property',
|
|
972
|
+
offset,
|
|
973
|
+
length: -1,
|
|
974
|
+
parent: currentParent,
|
|
975
|
+
children: [],
|
|
976
|
+
});
|
|
977
|
+
currentParent.children!.push({
|
|
978
|
+
type: 'string',
|
|
979
|
+
value: name,
|
|
980
|
+
offset,
|
|
981
|
+
length,
|
|
982
|
+
parent: currentParent,
|
|
983
|
+
});
|
|
984
|
+
},
|
|
985
|
+
onObjectEnd: (offset: number, length: number) => {
|
|
986
|
+
currentParent.length = offset + length - currentParent.offset;
|
|
987
|
+
currentParent = currentParent.parent!;
|
|
988
|
+
ensurePropertyComplete(offset + length);
|
|
989
|
+
},
|
|
990
|
+
onArrayBegin: (offset: number, _length: number) => {
|
|
991
|
+
currentParent = onValue({
|
|
992
|
+
type: 'array',
|
|
993
|
+
offset,
|
|
994
|
+
length: -1,
|
|
995
|
+
parent: currentParent,
|
|
996
|
+
children: [],
|
|
997
|
+
});
|
|
998
|
+
},
|
|
999
|
+
onArrayEnd: (offset: number, length: number) => {
|
|
1000
|
+
currentParent.length = offset + length - currentParent.offset;
|
|
1001
|
+
currentParent = currentParent.parent!;
|
|
1002
|
+
ensurePropertyComplete(offset + length);
|
|
1003
|
+
},
|
|
1004
|
+
onLiteralValue: (value: any, offset: number, length: number) => {
|
|
1005
|
+
onValue({
|
|
1006
|
+
type: getNodeType(value),
|
|
1007
|
+
offset,
|
|
1008
|
+
length,
|
|
1009
|
+
parent: currentParent,
|
|
1010
|
+
value,
|
|
1011
|
+
});
|
|
1012
|
+
ensurePropertyComplete(offset + length);
|
|
1013
|
+
},
|
|
1014
|
+
onSeparator: (sep: string, offset: number, _length: number) => {
|
|
1015
|
+
if (currentParent.type === 'property') {
|
|
1016
|
+
if (sep === ':') {
|
|
1017
|
+
currentParent.colonOffset = offset;
|
|
1018
|
+
} else if (sep === ',') {
|
|
1019
|
+
ensurePropertyComplete(offset);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
onError: (error: ParseErrorCode, offset: number, length: number) => {
|
|
1024
|
+
errors.push({ error, offset, length });
|
|
1025
|
+
},
|
|
1026
|
+
};
|
|
1027
|
+
visit(text, visitor, options);
|
|
1028
|
+
|
|
1029
|
+
const result = currentParent.children![0];
|
|
1030
|
+
if (result) {
|
|
1031
|
+
delete result.parent;
|
|
1032
|
+
}
|
|
1033
|
+
return result;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Finds the node at the given path in a JSON DOM.
|
|
1038
|
+
*/
|
|
1039
|
+
export function findNodeAtLocation(root: Node, path: JSONPath): Node | undefined {
|
|
1040
|
+
if (!root) {
|
|
1041
|
+
return undefined;
|
|
1042
|
+
}
|
|
1043
|
+
let node = root;
|
|
1044
|
+
for (const segment of path) {
|
|
1045
|
+
if (typeof segment === 'string') {
|
|
1046
|
+
if (node.type !== 'object' || !Array.isArray(node.children)) {
|
|
1047
|
+
return undefined;
|
|
1048
|
+
}
|
|
1049
|
+
let found = false;
|
|
1050
|
+
for (const propertyNode of node.children) {
|
|
1051
|
+
if (
|
|
1052
|
+
Array.isArray(propertyNode.children) &&
|
|
1053
|
+
propertyNode.children[0].value === segment
|
|
1054
|
+
) {
|
|
1055
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1056
|
+
node = propertyNode.children[1];
|
|
1057
|
+
found = true;
|
|
1058
|
+
break;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
if (!found) {
|
|
1062
|
+
return undefined;
|
|
1063
|
+
}
|
|
1064
|
+
} else {
|
|
1065
|
+
const index = <number>segment;
|
|
1066
|
+
if (
|
|
1067
|
+
node.type !== 'array' ||
|
|
1068
|
+
index < 0 ||
|
|
1069
|
+
!Array.isArray(node.children) ||
|
|
1070
|
+
index >= node.children.length
|
|
1071
|
+
) {
|
|
1072
|
+
return undefined;
|
|
1073
|
+
}
|
|
1074
|
+
node = node.children[index];
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return node;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Gets the JSON path of the given JSON DOM node
|
|
1082
|
+
*/
|
|
1083
|
+
export function getNodePath(node: Node): JSONPath {
|
|
1084
|
+
if (!node.parent || !node.parent.children) {
|
|
1085
|
+
return [];
|
|
1086
|
+
}
|
|
1087
|
+
const path = getNodePath(node.parent);
|
|
1088
|
+
if (node.parent.type === 'property') {
|
|
1089
|
+
const key = node.parent.children[0].value;
|
|
1090
|
+
path.push(key);
|
|
1091
|
+
} else if (node.parent.type === 'array') {
|
|
1092
|
+
const index = node.parent.children.indexOf(node);
|
|
1093
|
+
if (index !== -1) {
|
|
1094
|
+
path.push(index);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return path;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Evaluates the JavaScript object of the given JSON DOM node
|
|
1102
|
+
*/
|
|
1103
|
+
export function getNodeValue(node: Node): any {
|
|
1104
|
+
switch (node.type) {
|
|
1105
|
+
case 'array':
|
|
1106
|
+
return node.children!.map(getNodeValue);
|
|
1107
|
+
case 'object':
|
|
1108
|
+
const obj = Object.create(null);
|
|
1109
|
+
for (const prop of node.children!) {
|
|
1110
|
+
const valueNode = prop.children![1];
|
|
1111
|
+
if (valueNode) {
|
|
1112
|
+
obj[prop.children![0].value] = getNodeValue(valueNode);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
return obj;
|
|
1116
|
+
case 'null':
|
|
1117
|
+
case 'string':
|
|
1118
|
+
case 'number':
|
|
1119
|
+
case 'boolean':
|
|
1120
|
+
return node.value;
|
|
1121
|
+
default:
|
|
1122
|
+
return undefined;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
export function contains(
|
|
1127
|
+
node: Node,
|
|
1128
|
+
offset: number,
|
|
1129
|
+
includeRightBound = false,
|
|
1130
|
+
): boolean {
|
|
1131
|
+
return (
|
|
1132
|
+
(offset >= node.offset && offset < node.offset + node.length) ||
|
|
1133
|
+
(includeRightBound && offset === node.offset + node.length)
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
|
|
1139
|
+
*/
|
|
1140
|
+
export function findNodeAtOffset(
|
|
1141
|
+
node: Node,
|
|
1142
|
+
offset: number,
|
|
1143
|
+
includeRightBound = false,
|
|
1144
|
+
): Node | undefined {
|
|
1145
|
+
if (contains(node, offset, includeRightBound)) {
|
|
1146
|
+
const { children } = node;
|
|
1147
|
+
if (Array.isArray(children)) {
|
|
1148
|
+
for (let i = 0; i < children.length && children[i].offset <= offset; i++) {
|
|
1149
|
+
const item = findNodeAtOffset(children[i], offset, includeRightBound);
|
|
1150
|
+
if (item) {
|
|
1151
|
+
return item;
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
return node;
|
|
1156
|
+
}
|
|
1157
|
+
return undefined;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Parses the given text and invokes the visitor functions for each object, array and literal reached.
|
|
1162
|
+
*/
|
|
1163
|
+
export function visit(
|
|
1164
|
+
text: string,
|
|
1165
|
+
visitor: JSONVisitor,
|
|
1166
|
+
options: ParseOptions = ParseOptions.DEFAULT,
|
|
1167
|
+
): any {
|
|
1168
|
+
const _scanner = createScanner(text, false);
|
|
1169
|
+
|
|
1170
|
+
function toNoArgVisit(
|
|
1171
|
+
visitFunction?: (offset: number, length: number) => void,
|
|
1172
|
+
): () => void {
|
|
1173
|
+
return visitFunction
|
|
1174
|
+
? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength())
|
|
1175
|
+
: () => true;
|
|
1176
|
+
}
|
|
1177
|
+
function toOneArgVisit<T>(
|
|
1178
|
+
visitFunction?: (arg: T, offset: number, length: number) => void,
|
|
1179
|
+
): (arg: T) => void {
|
|
1180
|
+
return visitFunction
|
|
1181
|
+
? (arg: T) =>
|
|
1182
|
+
visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength())
|
|
1183
|
+
: () => true;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
const onObjectBegin = toNoArgVisit(visitor.onObjectBegin);
|
|
1187
|
+
const onObjectProperty = toOneArgVisit(visitor.onObjectProperty);
|
|
1188
|
+
const onObjectEnd = toNoArgVisit(visitor.onObjectEnd);
|
|
1189
|
+
const onArrayBegin = toNoArgVisit(visitor.onArrayBegin);
|
|
1190
|
+
const onArrayEnd = toNoArgVisit(visitor.onArrayEnd);
|
|
1191
|
+
const onLiteralValue = toOneArgVisit(visitor.onLiteralValue);
|
|
1192
|
+
const onSeparator = toOneArgVisit(visitor.onSeparator);
|
|
1193
|
+
const onComment = toNoArgVisit(visitor.onComment);
|
|
1194
|
+
const onError = toOneArgVisit(visitor.onError);
|
|
1195
|
+
|
|
1196
|
+
const disallowComments = options && options.disallowComments;
|
|
1197
|
+
const allowTrailingComma = options && options.allowTrailingComma;
|
|
1198
|
+
function scanNext(): SyntaxKind {
|
|
1199
|
+
// eslint-disable-next-line no-constant-condition
|
|
1200
|
+
while (true) {
|
|
1201
|
+
const token = _scanner.scan();
|
|
1202
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
1203
|
+
switch (_scanner.getTokenError()) {
|
|
1204
|
+
case ScanError.InvalidUnicode:
|
|
1205
|
+
handleError(ParseErrorCode.InvalidUnicode);
|
|
1206
|
+
break;
|
|
1207
|
+
case ScanError.InvalidEscapeCharacter:
|
|
1208
|
+
handleError(ParseErrorCode.InvalidEscapeCharacter);
|
|
1209
|
+
break;
|
|
1210
|
+
case ScanError.UnexpectedEndOfNumber:
|
|
1211
|
+
handleError(ParseErrorCode.UnexpectedEndOfNumber);
|
|
1212
|
+
break;
|
|
1213
|
+
case ScanError.UnexpectedEndOfComment:
|
|
1214
|
+
if (!disallowComments) {
|
|
1215
|
+
handleError(ParseErrorCode.UnexpectedEndOfComment);
|
|
1216
|
+
}
|
|
1217
|
+
break;
|
|
1218
|
+
case ScanError.UnexpectedEndOfString:
|
|
1219
|
+
handleError(ParseErrorCode.UnexpectedEndOfString);
|
|
1220
|
+
break;
|
|
1221
|
+
case ScanError.InvalidCharacter:
|
|
1222
|
+
handleError(ParseErrorCode.InvalidCharacter);
|
|
1223
|
+
break;
|
|
1224
|
+
}
|
|
1225
|
+
switch (token) {
|
|
1226
|
+
case SyntaxKind.LineCommentTrivia:
|
|
1227
|
+
case SyntaxKind.BlockCommentTrivia:
|
|
1228
|
+
if (disallowComments) {
|
|
1229
|
+
handleError(ParseErrorCode.InvalidCommentToken);
|
|
1230
|
+
} else {
|
|
1231
|
+
onComment();
|
|
1232
|
+
}
|
|
1233
|
+
break;
|
|
1234
|
+
case SyntaxKind.Unknown:
|
|
1235
|
+
handleError(ParseErrorCode.InvalidSymbol);
|
|
1236
|
+
break;
|
|
1237
|
+
case SyntaxKind.Trivia:
|
|
1238
|
+
case SyntaxKind.LineBreakTrivia:
|
|
1239
|
+
break;
|
|
1240
|
+
default:
|
|
1241
|
+
return token;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
function handleError(
|
|
1247
|
+
error: ParseErrorCode,
|
|
1248
|
+
skipUntilAfter: SyntaxKind[] = [],
|
|
1249
|
+
skipUntil: SyntaxKind[] = [],
|
|
1250
|
+
): void {
|
|
1251
|
+
onError(error);
|
|
1252
|
+
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
1253
|
+
let token = _scanner.getToken();
|
|
1254
|
+
while (token !== SyntaxKind.EOF) {
|
|
1255
|
+
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
1256
|
+
scanNext();
|
|
1257
|
+
break;
|
|
1258
|
+
} else if (skipUntil.indexOf(token) !== -1) {
|
|
1259
|
+
break;
|
|
1260
|
+
}
|
|
1261
|
+
token = scanNext();
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function parseString(isValue: boolean): boolean {
|
|
1267
|
+
const value = _scanner.getTokenValue();
|
|
1268
|
+
if (isValue) {
|
|
1269
|
+
onLiteralValue(value);
|
|
1270
|
+
} else {
|
|
1271
|
+
onObjectProperty(value);
|
|
1272
|
+
}
|
|
1273
|
+
scanNext();
|
|
1274
|
+
return true;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
function parseLiteral(): boolean {
|
|
1278
|
+
switch (_scanner.getToken()) {
|
|
1279
|
+
case SyntaxKind.NumericLiteral:
|
|
1280
|
+
let value = 0;
|
|
1281
|
+
try {
|
|
1282
|
+
value = JSON.parse(_scanner.getTokenValue());
|
|
1283
|
+
if (typeof value !== 'number') {
|
|
1284
|
+
handleError(ParseErrorCode.InvalidNumberFormat);
|
|
1285
|
+
value = 0;
|
|
1286
|
+
}
|
|
1287
|
+
} catch (e) {
|
|
1288
|
+
handleError(ParseErrorCode.InvalidNumberFormat);
|
|
1289
|
+
}
|
|
1290
|
+
onLiteralValue(value);
|
|
1291
|
+
break;
|
|
1292
|
+
case SyntaxKind.NullKeyword:
|
|
1293
|
+
onLiteralValue(null);
|
|
1294
|
+
break;
|
|
1295
|
+
case SyntaxKind.TrueKeyword:
|
|
1296
|
+
onLiteralValue(true);
|
|
1297
|
+
break;
|
|
1298
|
+
case SyntaxKind.FalseKeyword:
|
|
1299
|
+
onLiteralValue(false);
|
|
1300
|
+
break;
|
|
1301
|
+
default:
|
|
1302
|
+
return false;
|
|
1303
|
+
}
|
|
1304
|
+
scanNext();
|
|
1305
|
+
return true;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
function parseProperty(): boolean {
|
|
1309
|
+
if (_scanner.getToken() !== SyntaxKind.StringLiteral) {
|
|
1310
|
+
handleError(
|
|
1311
|
+
ParseErrorCode.PropertyNameExpected,
|
|
1312
|
+
[],
|
|
1313
|
+
[SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken],
|
|
1314
|
+
);
|
|
1315
|
+
return false;
|
|
1316
|
+
}
|
|
1317
|
+
parseString(false);
|
|
1318
|
+
if (_scanner.getToken() === SyntaxKind.ColonToken) {
|
|
1319
|
+
onSeparator(':');
|
|
1320
|
+
scanNext(); // consume colon
|
|
1321
|
+
|
|
1322
|
+
if (!parseValue()) {
|
|
1323
|
+
handleError(
|
|
1324
|
+
ParseErrorCode.ValueExpected,
|
|
1325
|
+
[],
|
|
1326
|
+
[SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken],
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
} else {
|
|
1330
|
+
handleError(
|
|
1331
|
+
ParseErrorCode.ColonExpected,
|
|
1332
|
+
[],
|
|
1333
|
+
[SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken],
|
|
1334
|
+
);
|
|
1335
|
+
}
|
|
1336
|
+
return true;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
function parseObject(): boolean {
|
|
1340
|
+
onObjectBegin();
|
|
1341
|
+
scanNext(); // consume open brace
|
|
1342
|
+
|
|
1343
|
+
let needsComma = false;
|
|
1344
|
+
while (
|
|
1345
|
+
_scanner.getToken() !== SyntaxKind.CloseBraceToken &&
|
|
1346
|
+
_scanner.getToken() !== SyntaxKind.EOF
|
|
1347
|
+
) {
|
|
1348
|
+
if (_scanner.getToken() === SyntaxKind.CommaToken) {
|
|
1349
|
+
if (!needsComma) {
|
|
1350
|
+
handleError(ParseErrorCode.ValueExpected, [], []);
|
|
1351
|
+
}
|
|
1352
|
+
onSeparator(',');
|
|
1353
|
+
scanNext(); // consume comma
|
|
1354
|
+
if (_scanner.getToken() === SyntaxKind.CloseBraceToken && allowTrailingComma) {
|
|
1355
|
+
break;
|
|
1356
|
+
}
|
|
1357
|
+
} else if (needsComma) {
|
|
1358
|
+
handleError(ParseErrorCode.CommaExpected, [], []);
|
|
1359
|
+
}
|
|
1360
|
+
if (!parseProperty()) {
|
|
1361
|
+
handleError(
|
|
1362
|
+
ParseErrorCode.ValueExpected,
|
|
1363
|
+
[],
|
|
1364
|
+
[SyntaxKind.CloseBraceToken, SyntaxKind.CommaToken],
|
|
1365
|
+
);
|
|
1366
|
+
}
|
|
1367
|
+
needsComma = true;
|
|
1368
|
+
}
|
|
1369
|
+
onObjectEnd();
|
|
1370
|
+
if (_scanner.getToken() !== SyntaxKind.CloseBraceToken) {
|
|
1371
|
+
handleError(ParseErrorCode.CloseBraceExpected, [SyntaxKind.CloseBraceToken], []);
|
|
1372
|
+
} else {
|
|
1373
|
+
scanNext(); // consume close brace
|
|
1374
|
+
}
|
|
1375
|
+
return true;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
function parseArray(): boolean {
|
|
1379
|
+
onArrayBegin();
|
|
1380
|
+
scanNext(); // consume open bracket
|
|
1381
|
+
|
|
1382
|
+
let needsComma = false;
|
|
1383
|
+
while (
|
|
1384
|
+
_scanner.getToken() !== SyntaxKind.CloseBracketToken &&
|
|
1385
|
+
_scanner.getToken() !== SyntaxKind.EOF
|
|
1386
|
+
) {
|
|
1387
|
+
if (_scanner.getToken() === SyntaxKind.CommaToken) {
|
|
1388
|
+
if (!needsComma) {
|
|
1389
|
+
handleError(ParseErrorCode.ValueExpected, [], []);
|
|
1390
|
+
}
|
|
1391
|
+
onSeparator(',');
|
|
1392
|
+
scanNext(); // consume comma
|
|
1393
|
+
if (
|
|
1394
|
+
_scanner.getToken() === SyntaxKind.CloseBracketToken &&
|
|
1395
|
+
allowTrailingComma
|
|
1396
|
+
) {
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
} else if (needsComma) {
|
|
1400
|
+
handleError(ParseErrorCode.CommaExpected, [], []);
|
|
1401
|
+
}
|
|
1402
|
+
if (!parseValue()) {
|
|
1403
|
+
handleError(
|
|
1404
|
+
ParseErrorCode.ValueExpected,
|
|
1405
|
+
[],
|
|
1406
|
+
[SyntaxKind.CloseBracketToken, SyntaxKind.CommaToken],
|
|
1407
|
+
);
|
|
1408
|
+
}
|
|
1409
|
+
needsComma = true;
|
|
1410
|
+
}
|
|
1411
|
+
onArrayEnd();
|
|
1412
|
+
if (_scanner.getToken() !== SyntaxKind.CloseBracketToken) {
|
|
1413
|
+
handleError(
|
|
1414
|
+
ParseErrorCode.CloseBracketExpected,
|
|
1415
|
+
[SyntaxKind.CloseBracketToken],
|
|
1416
|
+
[],
|
|
1417
|
+
);
|
|
1418
|
+
} else {
|
|
1419
|
+
scanNext(); // consume close bracket
|
|
1420
|
+
}
|
|
1421
|
+
return true;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
function parseValue(): boolean {
|
|
1425
|
+
switch (_scanner.getToken()) {
|
|
1426
|
+
case SyntaxKind.OpenBracketToken:
|
|
1427
|
+
return parseArray();
|
|
1428
|
+
case SyntaxKind.OpenBraceToken:
|
|
1429
|
+
return parseObject();
|
|
1430
|
+
case SyntaxKind.StringLiteral:
|
|
1431
|
+
return parseString(true);
|
|
1432
|
+
default:
|
|
1433
|
+
return parseLiteral();
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
scanNext();
|
|
1438
|
+
if (_scanner.getToken() === SyntaxKind.EOF) {
|
|
1439
|
+
if (options.allowEmptyContent) {
|
|
1440
|
+
return true;
|
|
1441
|
+
}
|
|
1442
|
+
handleError(ParseErrorCode.ValueExpected, [], []);
|
|
1443
|
+
return false;
|
|
1444
|
+
}
|
|
1445
|
+
if (!parseValue()) {
|
|
1446
|
+
handleError(ParseErrorCode.ValueExpected, [], []);
|
|
1447
|
+
return false;
|
|
1448
|
+
}
|
|
1449
|
+
if (_scanner.getToken() !== SyntaxKind.EOF) {
|
|
1450
|
+
handleError(ParseErrorCode.EndOfFileExpected, [], []);
|
|
1451
|
+
}
|
|
1452
|
+
return true;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* Takes JSON with JavaScript-style comments and remove
|
|
1457
|
+
* them. Optionally replaces every none-newline character
|
|
1458
|
+
* of comments with a replaceCharacter
|
|
1459
|
+
*/
|
|
1460
|
+
export function stripComments(text: string, replaceCh?: string): string {
|
|
1461
|
+
const _scanner = createScanner(text);
|
|
1462
|
+
const parts: string[] = [];
|
|
1463
|
+
let kind: SyntaxKind;
|
|
1464
|
+
let offset = 0;
|
|
1465
|
+
let pos: number;
|
|
1466
|
+
|
|
1467
|
+
do {
|
|
1468
|
+
pos = _scanner.getPosition();
|
|
1469
|
+
kind = _scanner.scan();
|
|
1470
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
1471
|
+
switch (kind) {
|
|
1472
|
+
case SyntaxKind.LineCommentTrivia:
|
|
1473
|
+
case SyntaxKind.BlockCommentTrivia:
|
|
1474
|
+
case SyntaxKind.EOF:
|
|
1475
|
+
if (offset !== pos) {
|
|
1476
|
+
parts.push(text.substring(offset, pos));
|
|
1477
|
+
}
|
|
1478
|
+
if (replaceCh !== undefined) {
|
|
1479
|
+
parts.push(_scanner.getTokenValue().replace(/[^\r\n]/g, replaceCh));
|
|
1480
|
+
}
|
|
1481
|
+
offset = _scanner.getPosition();
|
|
1482
|
+
break;
|
|
1483
|
+
}
|
|
1484
|
+
} while (kind !== SyntaxKind.EOF);
|
|
1485
|
+
|
|
1486
|
+
return parts.join('');
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
export function getNodeType(value: any): NodeType {
|
|
1490
|
+
switch (typeof value) {
|
|
1491
|
+
case 'boolean':
|
|
1492
|
+
return 'boolean';
|
|
1493
|
+
case 'number':
|
|
1494
|
+
return 'number';
|
|
1495
|
+
case 'string':
|
|
1496
|
+
return 'string';
|
|
1497
|
+
case 'object': {
|
|
1498
|
+
if (!value) {
|
|
1499
|
+
return 'null';
|
|
1500
|
+
}
|
|
1501
|
+
if (Array.isArray(value)) {
|
|
1502
|
+
return 'array';
|
|
1503
|
+
}
|
|
1504
|
+
return 'object';
|
|
1505
|
+
}
|
|
1506
|
+
default:
|
|
1507
|
+
return 'null';
|
|
1508
|
+
}
|
|
1509
|
+
}
|