ember-inspector 4.13.1-alpha.2024.8.9 → 4.13.1-alpha.2025.6.7
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/README.md +10 -2
- package/app/components/app-picker.hbs +2 -2
- package/app/components/component-tree-item.hbs +13 -13
- package/app/components/component-tree-toolbar.hbs +3 -3
- package/app/components/{date-property-field.js → date-property-field.ts} +6 -5
- package/app/components/deprecation-item-source.hbs +1 -1
- package/app/components/deprecation-item.hbs +1 -1
- package/app/components/deprecations-toolbar.hbs +1 -1
- package/app/components/item-types.hbs +7 -7
- package/app/components/list-cell.hbs +3 -3
- package/app/components/list-content.hbs +4 -3
- package/app/components/list-content.ts +96 -0
- package/app/components/list.hbs +3 -3
- package/app/components/list.js +7 -7
- package/app/components/model-types-toolbar.hbs +3 -3
- package/app/components/object-inspector/dependent-keys.hbs +4 -4
- package/app/components/object-inspector/errors.hbs +4 -4
- package/app/components/object-inspector/properties-all.hbs +1 -1
- package/app/components/object-inspector/properties-grouped.hbs +5 -5
- package/app/components/object-inspector/property.hbs +16 -16
- package/app/components/object-inspector/property.ts +26 -17
- package/app/components/object-inspector/sort-properties.js +12 -4
- package/app/components/object-inspector.hbs +8 -8
- package/app/components/object-inspector.js +1 -1
- package/app/components/promise-item.hbs +11 -11
- package/app/components/promise-item.js +8 -6
- package/app/components/promise-tree-toolbar.hbs +5 -5
- package/app/components/records-toolbar.hbs +2 -2
- package/app/components/render-item.hbs +4 -4
- package/app/components/render-item.ts +12 -9
- package/app/components/render-tree-toolbar.hbs +1 -1
- package/app/components/route-cell-name.hbs +1 -1
- package/app/components/route-cell-name.js +3 -2
- package/app/components/route-tree-toolbar.hbs +2 -2
- package/app/components/scroll-container.js +2 -0
- package/app/components/side-nav.hbs +5 -5
- package/app/components/side-nav.js +1 -1
- package/app/computed/{debounce.js → debounce.ts} +7 -5
- package/app/config/environment.d.ts +5 -2
- package/app/controllers/app-config.js +1 -0
- package/app/controllers/application.js +33 -34
- package/app/controllers/component-tree.js +3 -2
- package/app/controllers/container-type.js +2 -1
- package/app/controllers/container-types/{index.js → index.ts} +5 -2
- package/app/controllers/container-types.js +3 -6
- package/app/controllers/deprecations.js +16 -11
- package/app/controllers/libraries.js +1 -0
- package/app/controllers/model-types.js +1 -0
- package/app/controllers/promise-tree.ts +149 -0
- package/app/controllers/records.js +18 -26
- package/app/controllers/{render-tree.js → render-tree.ts} +54 -45
- package/app/controllers/route-tree.js +7 -5
- package/app/helpers/build-style.js +1 -1
- package/app/initializers/setup.js +1 -1
- package/app/libs/promise-assembler.ts +249 -0
- package/app/libs/resizable-columns.js +10 -10
- package/app/models/{promise.js → promise.ts} +72 -69
- package/app/{router.js → router.ts} +1 -1
- package/app/routes/app-detected.js +3 -5
- package/app/routes/application.js +6 -12
- package/app/routes/deprecations.js +7 -16
- package/app/routes/launch.js +2 -1
- package/app/routes/libraries.js +2 -1
- package/app/routes/model-type.js +2 -3
- package/app/routes/model-types.ts +57 -0
- package/app/routes/promise-tree.ts +63 -0
- package/app/routes/records.ts +78 -0
- package/app/routes/render-tree.ts +93 -0
- package/app/routes/route-tree.js +0 -1
- package/app/routes/{tab.js → tab.ts} +9 -2
- package/app/routes/whats-new.js +1 -1
- package/app/services/adapters/{basic.js → basic.ts} +36 -30
- package/app/services/adapters/{bookmarklet.js → bookmarklet.ts} +17 -24
- package/app/services/adapters/{chrome.js → chrome.ts} +1 -2
- package/app/services/adapters/{web-extension.js → web-extension.ts} +43 -46
- package/app/services/adapters/websocket.ts +40 -0
- package/app/services/layout.ts +88 -0
- package/app/services/port.ts +195 -0
- package/app/services/storage/{local.js → local.ts} +7 -20
- package/app/services/storage/{memory.js → memory.ts} +6 -21
- package/app/services/{storage.js → storage.ts} +9 -20
- package/app/styles/base.scss +4 -2
- package/app/styles/colors.scss +33 -31
- package/app/styles/component_tree.scss +56 -51
- package/app/styles/dropdown.scss +2 -2
- package/app/styles/ember-table.scss +3 -3
- package/app/styles/mixin.scss +26 -26
- package/app/styles/object_inspector.scss +22 -21
- package/app/styles/utils.scss +408 -122
- package/app/templates/application.hbs +11 -11
- package/app/templates/component-tree.hbs +1 -1
- package/app/templates/deprecations.hbs +2 -3
- package/app/templates/info.hbs +10 -10
- package/app/templates/promise-tree.hbs +1 -1
- package/app/templates/render-tree.hbs +1 -1
- package/app/templates/route-tree.hbs +1 -1
- package/app/utils/escape-reg-exp.ts +3 -2
- package/app/utils/nullish.ts +7 -0
- package/app/utils/parse-text.ts +4 -5
- package/app/utils/truncate.js +0 -1
- package/config/ember-cli-update.json +5 -3
- package/config/ember-try.js +117 -72
- package/config/environment.js +1 -1
- package/config/optional-features.json +2 -1
- package/dist/bookmarklet/load_inspector.js +30 -11
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.524.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.582.b77d8494154b524e9f91.js +42 -0
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.css +150 -155
- package/dist/bookmarklet/panes-3-16-0/assets/ember-inspector.js +486 -590
- package/dist/bookmarklet/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/bookmarklet/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.css +147 -148
- package/dist/bookmarklet/panes-3-16-0/assets/vendor.js +5153 -5980
- package/dist/bookmarklet/panes-3-16-0/ember_debug.js +250 -268
- package/dist/bookmarklet/panes-3-16-0/index.html +3 -4
- package/dist/chrome/background.js +26 -21
- package/dist/chrome/boot.js +1 -1
- package/dist/chrome/content-script.js +11 -11
- package/dist/chrome/devtools.js +12 -3
- package/dist/chrome/manifest.json +2 -2
- package/dist/chrome/options.js +17 -12
- package/dist/chrome/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.524.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/chrome/panes-3-16-0/assets/chunk.582.b77d8494154b524e9f91.js +42 -0
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.css +150 -155
- package/dist/chrome/panes-3-16-0/assets/ember-inspector.js +486 -590
- package/dist/chrome/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/chrome/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/chrome/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/chrome/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/chrome/panes-3-16-0/assets/vendor.css +147 -148
- package/dist/chrome/panes-3-16-0/assets/vendor.js +5153 -5980
- package/dist/chrome/panes-3-16-0/ember_debug.js +250 -268
- package/dist/chrome/panes-3-16-0/index.html +3 -4
- package/dist/chrome/scripts/in-page-script.js +19 -13
- package/dist/firefox/background.js +26 -21
- package/dist/firefox/boot.js +1 -1
- package/dist/firefox/content-script.js +11 -11
- package/dist/firefox/devtools.js +12 -3
- package/dist/firefox/manifest.json +2 -2
- package/dist/firefox/options.js +17 -12
- package/dist/firefox/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.524.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/firefox/panes-3-16-0/assets/chunk.582.b77d8494154b524e9f91.js +42 -0
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.css +150 -155
- package/dist/firefox/panes-3-16-0/assets/ember-inspector.js +486 -590
- package/dist/firefox/panes-3-16-0/assets/svg/ellipsis.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-bug.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-components.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-container.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-data.svg +1 -1
- package/dist/firefox/panes-3-16-0/assets/svg/nav-deprecations.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-info.svg +3 -3
- package/dist/firefox/panes-3-16-0/assets/svg/nav-promises.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-render-performance.svg +2 -2
- package/dist/firefox/panes-3-16-0/assets/svg/nav-route-tree.svg +7 -7
- package/dist/firefox/panes-3-16-0/assets/vendor.css +147 -148
- package/dist/firefox/panes-3-16-0/assets/vendor.js +5153 -5980
- package/dist/firefox/panes-3-16-0/ember_debug.js +250 -268
- package/dist/firefox/panes-3-16-0/index.html +3 -4
- package/dist/firefox/scripts/in-page-script.js +19 -13
- package/dist/websocket/assets/chunk.443.86a005e528b587663b78.js +1135 -0
- package/dist/websocket/assets/chunk.443.86a005e528b587663b78.js.LICENSE.txt +18 -0
- package/dist/websocket/assets/chunk.524.6a5edcbbcf29cbe1b167.js +40 -0
- package/dist/websocket/assets/chunk.582.b77d8494154b524e9f91.js +42 -0
- package/dist/websocket/assets/ember-inspector.css +150 -155
- package/dist/websocket/assets/ember-inspector.js +486 -590
- package/dist/websocket/assets/svg/ellipsis.svg +3 -3
- package/dist/websocket/assets/svg/nav-bug.svg +1 -1
- package/dist/websocket/assets/svg/nav-components.svg +2 -2
- package/dist/websocket/assets/svg/nav-container.svg +1 -1
- package/dist/websocket/assets/svg/nav-data.svg +1 -1
- package/dist/websocket/assets/svg/nav-deprecations.svg +3 -3
- package/dist/websocket/assets/svg/nav-info.svg +3 -3
- package/dist/websocket/assets/svg/nav-promises.svg +2 -2
- package/dist/websocket/assets/svg/nav-render-performance.svg +2 -2
- package/dist/websocket/assets/svg/nav-route-tree.svg +7 -7
- package/dist/websocket/assets/vendor.css +147 -148
- package/dist/websocket/assets/vendor.js +5153 -5980
- package/dist/websocket/ember_debug.js +250 -268
- package/dist/websocket/index.html +3 -4
- package/ember-cli-build.js +11 -11
- package/ember_debug/adapters/basic.js +2 -1
- package/ember_debug/adapters/bookmarklet.js +1 -0
- package/ember_debug/adapters/firefox.js +3 -3
- package/ember_debug/adapters/web-extension.js +2 -1
- package/ember_debug/data-debug.js +5 -6
- package/ember_debug/deprecation-debug.js +8 -8
- package/ember_debug/general-debug.js +1 -1
- package/ember_debug/libs/capture-render-tree.js +0 -1
- package/ember_debug/libs/promise-assembler.js +1 -0
- package/ember_debug/libs/render-tree.js +13 -12
- package/ember_debug/libs/source-map.js +5 -4
- package/ember_debug/libs/view-inspection.js +12 -12
- package/ember_debug/main.js +1 -1
- package/ember_debug/models/profile-manager.js +2 -1
- package/ember_debug/object-inspector.js +19 -18
- package/ember_debug/port.js +1 -0
- package/ember_debug/promise-debug.js +1 -1
- package/ember_debug/route-debug.js +3 -2
- package/ember_debug/services/session.js +1 -1
- package/ember_debug/utils/classify.js +1 -1
- package/ember_debug/utils/ember/debug.js +2 -0
- package/ember_debug/utils/ember/loader.js +2 -2
- package/ember_debug/utils/ember/runloop.js +2 -0
- package/ember_debug/utils/ember-object-names.js +2 -2
- package/ember_debug/utils/ember.js +9 -3
- package/ember_debug/utils/evented.js +1 -1
- package/ember_debug/utils/get-object-name.js +2 -2
- package/ember_debug/utils/rsvp.js +1 -0
- package/ember_debug/utils/type-check.js +5 -1
- package/ember_debug/vendor/startup-wrapper.js +4 -1
- package/ember_debug/view-debug.js +3 -2
- package/eslint.config.mjs +172 -0
- package/gulpfile.js +1 -1
- package/lib/ui/addon/components/drag-handle.hbs +4 -4
- package/lib/ui/addon/components/drag-handle.js +3 -1
- package/lib/ui/addon/components/empty-message.hbs +1 -1
- package/lib/ui/addon/components/error-page.hbs +3 -3
- package/lib/ui/addon/components/resizable-column.js +1 -1
- package/lib/ui/addon/components/toolbar-clear-button.hbs +1 -1
- package/lib/ui/addon/components/toolbar-reload-button.hbs +1 -1
- package/lib/ui/addon/components/toolbar-search-field.hbs +2 -2
- package/lib/ui/addon/styles/_disclosure-triangle.scss +3 -1
- package/lib/ui/addon/styles/_drag-handle.scss +7 -7
- package/lib/ui/addon/styles/_empty-message.scss +1 -1
- package/lib/ui/addon/styles/_error-page.scss +8 -7
- package/lib/ui/addon/styles/_list.scss +46 -45
- package/lib/ui/addon/styles/_nav.scss +29 -27
- package/lib/ui/addon/styles/_object-inspector-toggle.scss +5 -5
- package/lib/ui/addon/styles/_pill.scss +4 -4
- package/lib/ui/addon/styles/_send-to-console.scss +1 -1
- package/lib/ui/addon/styles/_split.scss +17 -20
- package/lib/ui/addon/styles/addon.scss +13 -13
- package/lib/ui/addon/styles/toolbar/_checkbox.scss +5 -5
- package/lib/ui/addon/styles/toolbar/_icon-button.scss +44 -25
- package/lib/ui/addon/styles/toolbar/_index.scss +6 -5
- package/lib/ui/addon/styles/toolbar/_radio.scss +10 -10
- package/lib/ui/addon/styles/toolbar/_search.scss +5 -3
- package/package.json +85 -86
- package/public/assets/svg/ellipsis.svg +3 -3
- package/public/assets/svg/nav-bug.svg +1 -1
- package/public/assets/svg/nav-components.svg +2 -2
- package/public/assets/svg/nav-container.svg +1 -1
- package/public/assets/svg/nav-data.svg +1 -1
- package/public/assets/svg/nav-deprecations.svg +3 -3
- package/public/assets/svg/nav-info.svg +3 -3
- package/public/assets/svg/nav-promises.svg +2 -2
- package/public/assets/svg/nav-render-performance.svg +2 -2
- package/public/assets/svg/nav-route-tree.svg +7 -7
- package/scripts/download-panes.js +1 -1
- package/skeletons/bookmarklet/load_inspector.js +30 -11
- package/skeletons/web-extension/background.js +26 -21
- package/skeletons/web-extension/boot.js +1 -1
- package/skeletons/web-extension/content-script.js +11 -11
- package/skeletons/web-extension/devtools.js +12 -3
- package/skeletons/web-extension/manifest.json +2 -2
- package/skeletons/web-extension/options.js +17 -12
- package/skeletons/web-extension/scripts/in-page-script.js +19 -13
- package/testem.js +0 -1
- package/tests/acceptance/app-picker-test.js +4 -4
- package/tests/acceptance/component-tree-test.js +43 -57
- package/tests/acceptance/container-test.js +0 -2
- package/tests/acceptance/data-test.js +8 -10
- package/tests/acceptance/deprecation-test.js +8 -12
- package/tests/acceptance/info-test.js +2 -2
- package/tests/acceptance/object-inspector-test.js +62 -110
- package/tests/acceptance/promise-test.js +1 -11
- package/tests/acceptance/render-tree-test.js +2 -2
- package/tests/acceptance/route-tree-test.js +12 -14
- package/tests/acceptance/whats-new-test.js +3 -3
- package/tests/ember_debug/container-debug-test.js +4 -4
- package/tests/ember_debug/deprecation-debug-test.js +8 -5
- package/tests/ember_debug/ember-debug-test.js +1 -4
- package/tests/ember_debug/object-inspector-test.js +44 -44
- package/tests/ember_debug/profile-manager-test.js +140 -165
- package/tests/ember_debug/profile-node-test.js +3 -3
- package/tests/ember_debug/promise-assembler-test.js +12 -9
- package/tests/ember_debug/promise-debug-test.js +5 -6
- package/tests/ember_debug/route-debug-test.js +8 -7
- package/tests/ember_debug/view-debug-test.js +179 -181
- package/tests/helpers/{index.js → index.ts} +6 -5
- package/tests/helpers/setup-ember-debug-test.js +14 -0
- package/tests/integration/injection-test.js +12 -13
- package/tests/test-adapter.js +15 -15
- package/tests/test-helper.js +6 -1
- package/tests/unit/check-current-route-test.js +0 -4
- package/tests/unit/resizable-columns-test.js +53 -51
- package/tests/unit/utils/parse-text-test.js +3 -3
- package/tests/unit/utils/search-match-test.js +5 -5
- package/tests/unit/utils/type-check-test.js +22 -0
- package/tsconfig.json +3 -1
- package/types/ember-inspector/index.d.ts +2 -1
- package/types/global.d.ts +1 -7
- package/.editorconfig +0 -19
- package/.ember-cli +0 -15
- package/.eslintignore +0 -33
- package/.eslintrc.js +0 -86
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/dependabot.yml +0 -14
- package/.github/pull_request_template.md +0 -4
- package/.github/workflows/build.yml +0 -339
- package/.github/workflows/plan-release.yml +0 -83
- package/.github/workflows/publish.yml +0 -60
- package/.prettierignore +0 -25
- package/.prettierrc.js +0 -14
- package/.release-plan.json +0 -17
- package/.stylelintrc.js +0 -3
- package/.template-lintrc.js +0 -12
- package/.tool-versions +0 -2
- package/.watchmanconfig +0 -3
- package/app/components/.gitkeep +0 -0
- package/app/components/list-content.js +0 -130
- package/app/controllers/.gitkeep +0 -0
- package/app/controllers/promise-tree.js +0 -130
- package/app/helpers/.gitkeep +0 -0
- package/app/libs/promise-assembler.js +0 -169
- package/app/models/.gitkeep +0 -0
- package/app/routes/.gitkeep +0 -0
- package/app/routes/model-types.js +0 -47
- package/app/routes/promise-tree.js +0 -48
- package/app/routes/records.js +0 -55
- package/app/routes/render-tree.js +0 -66
- package/app/services/adapters/websocket.js +0 -31
- package/app/services/layout.js +0 -39
- package/app/services/port.js +0 -90
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/bookmarklet/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/chrome/panes-3-16-0/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/chrome/panes-3-16-0/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/chrome/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/chrome/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/firefox/panes-3-16-0/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/firefox/panes-3-16-0/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/firefox/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/firefox/panes-3-16-0/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/dist/websocket/assets/chunk.143.143ca772b0b28102c74a.js +0 -28
- package/dist/websocket/assets/chunk.178.b50e140d1ed8777b583e.js +0 -9
- package/dist/websocket/assets/chunk.359.0be5d21f60d2b5d6d423.js +0 -2620
- package/dist/websocket/assets/chunk.359.0be5d21f60d2b5d6d423.js.LICENSE.txt +0 -67
- package/ember_debug/.eslintrc.js +0 -13
- package/tests/helpers/trigger-port.js +0 -6
- package/tests/unit/.gitkeep +0 -0
- /package/app/{app.js → app.ts} +0 -0
- /package/app/controllers/{info.js → info.ts} +0 -0
- /package/app/services/adapters/{firefox.js → firefox.ts} +0 -0
@@ -1,65 +1,71 @@
|
|
1
|
+
/* eslint-disable ember/no-computed-properties-in-native-classes */
|
1
2
|
import { action, computed } from '@ember/object';
|
2
3
|
import { tracked } from '@glimmer/tracking';
|
3
|
-
import { isEmpty } from '@ember/utils';
|
4
4
|
import Controller from '@ember/controller';
|
5
5
|
import { inject as service } from '@ember/service';
|
6
|
-
|
7
|
-
import
|
8
|
-
import
|
6
|
+
|
7
|
+
import escapeRegExp from '../utils/escape-reg-exp';
|
8
|
+
import debounceComputed from '../computed/debounce';
|
9
|
+
import type WebExtension from '../services/adapters/web-extension';
|
10
|
+
import type PortService from '../services/port';
|
11
|
+
import type StorageService from '../services/storage';
|
12
|
+
import type { RenderTreeModel } from '../routes/render-tree';
|
13
|
+
import { isNullish } from '../utils/nullish';
|
9
14
|
|
10
15
|
export default class RenderTreeController extends Controller {
|
11
|
-
@service adapter;
|
12
|
-
@service port;
|
16
|
+
@service declare adapter: WebExtension;
|
17
|
+
@service declare port: PortService;
|
13
18
|
/**
|
14
19
|
* Storage is needed for remembering if the user closed the warning
|
15
|
-
*
|
16
|
-
* @property storage
|
17
|
-
* @type {Service}
|
18
20
|
*/
|
19
|
-
@service storage;
|
21
|
+
@service declare storage: StorageService;
|
22
|
+
|
23
|
+
declare model: RenderTreeModel;
|
20
24
|
|
21
|
-
initialEmpty = false;
|
25
|
+
@tracked initialEmpty = false;
|
22
26
|
@tracked shouldHighlightRender = false;
|
23
27
|
@tracked search = '';
|
24
28
|
|
25
|
-
|
26
|
-
|
29
|
+
get escapedSearch() {
|
30
|
+
return escapeRegExp(this.search?.toLowerCase());
|
31
|
+
}
|
27
32
|
|
28
|
-
|
29
|
-
|
33
|
+
/**
|
34
|
+
* Indicate the table's header's height in pixels.
|
35
|
+
*
|
36
|
+
* @property headerHeight
|
37
|
+
* @type {Number}
|
38
|
+
*/
|
39
|
+
get headerHeight() {
|
40
|
+
return this.isWarningClosed ? 31 : 56;
|
41
|
+
}
|
30
42
|
|
31
43
|
/**
|
32
44
|
* Checks if the user previously closed the warning by referencing localStorage
|
33
|
-
*
|
34
|
-
* @property isWarningClosed
|
35
|
-
* @type {Boolean}
|
36
45
|
*/
|
37
46
|
get isWarningClosed() {
|
38
|
-
return !!this.storage.getItem(
|
47
|
+
return !!this.storage.getItem(
|
48
|
+
'is-render-tree-warning-closed' as keyof object,
|
49
|
+
);
|
39
50
|
}
|
40
51
|
|
41
52
|
set isWarningClosed(value) {
|
53
|
+
// @ts-expect-error Ignore this boolean/string mismatch for now.
|
42
54
|
this.storage.setItem('is-render-tree-warning-closed', value);
|
43
55
|
}
|
44
56
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
get headerHeight() {
|
52
|
-
return this.isWarningClosed ? 31 : 56;
|
57
|
+
get modelEmpty() {
|
58
|
+
return this.model.profiles.length === 0;
|
59
|
+
}
|
60
|
+
|
61
|
+
get showEmpty() {
|
62
|
+
return this.initialEmpty && this.modelEmpty;
|
53
63
|
}
|
54
64
|
|
55
65
|
// bound to the input field, updates the `search` property
|
56
66
|
// 300ms after changing
|
57
67
|
@debounceComputed('search', 300)
|
58
|
-
searchValue;
|
59
|
-
|
60
|
-
get escapedSearch() {
|
61
|
-
return escapeRegExp(this.search?.toLowerCase());
|
62
|
-
}
|
68
|
+
declare searchValue: string;
|
63
69
|
|
64
70
|
@computed('model.isHighlightSupported')
|
65
71
|
get isHighlightEnabled() {
|
@@ -68,14 +74,16 @@ export default class RenderTreeController extends Controller {
|
|
68
74
|
|
69
75
|
@computed('escapedSearch', 'model.profiles.@each.name', 'search')
|
70
76
|
get filtered() {
|
71
|
-
if (
|
77
|
+
if (isNullish(this.escapedSearch)) {
|
72
78
|
return this.model.profiles;
|
73
79
|
}
|
74
80
|
|
75
|
-
return this.model.profiles.filter(
|
76
|
-
|
77
|
-
|
78
|
-
|
81
|
+
return this.model.profiles.filter(
|
82
|
+
(item: RenderTreeModel['profiles'][number]) => {
|
83
|
+
const regExp = new RegExp(this.escapedSearch as string);
|
84
|
+
return recursiveMatch(item, regExp);
|
85
|
+
},
|
86
|
+
);
|
79
87
|
}
|
80
88
|
|
81
89
|
@action
|
@@ -85,7 +93,7 @@ export default class RenderTreeController extends Controller {
|
|
85
93
|
|
86
94
|
@action
|
87
95
|
closeWarning() {
|
88
|
-
this.
|
96
|
+
this.isWarningClosed = true;
|
89
97
|
}
|
90
98
|
|
91
99
|
@action
|
@@ -98,18 +106,19 @@ export default class RenderTreeController extends Controller {
|
|
98
106
|
}
|
99
107
|
}
|
100
108
|
|
101
|
-
function recursiveMatch(
|
102
|
-
|
103
|
-
|
104
|
-
|
109
|
+
function recursiveMatch(
|
110
|
+
item: RenderTreeModel['profiles'][number],
|
111
|
+
regExp: string | RegExp,
|
112
|
+
) {
|
113
|
+
if (item.name.toLowerCase().match(regExp)) {
|
105
114
|
return true;
|
106
115
|
}
|
107
|
-
|
108
|
-
for (
|
109
|
-
child = children[i];
|
116
|
+
|
117
|
+
for (const child of item.children) {
|
110
118
|
if (recursiveMatch(child, regExp)) {
|
111
119
|
return true;
|
112
120
|
}
|
113
121
|
}
|
122
|
+
|
114
123
|
return false;
|
115
124
|
}
|
@@ -1,4 +1,6 @@
|
|
1
|
+
// eslint-disable-next-line ember/no-computed-properties-in-native-classes
|
1
2
|
import { alias } from '@ember/object/computed';
|
3
|
+
// eslint-disable-next-line ember/no-computed-properties-in-native-classes
|
2
4
|
import { action, computed, set } from '@ember/object';
|
3
5
|
import Controller, { inject as controller } from '@ember/controller';
|
4
6
|
import { inject as service } from '@ember/service';
|
@@ -22,7 +24,7 @@ export default class RouteTreeController extends Controller {
|
|
22
24
|
'model.[]',
|
23
25
|
'options.{hideRoutes,hideSubstates}',
|
24
26
|
'currentRoute.{name,url}',
|
25
|
-
'searchValue'
|
27
|
+
'searchValue',
|
26
28
|
)
|
27
29
|
get filtered() {
|
28
30
|
if (!Array.isArray(this.model)) {
|
@@ -30,8 +32,8 @@ export default class RouteTreeController extends Controller {
|
|
30
32
|
}
|
31
33
|
return this.model.filter((routeItem) => {
|
32
34
|
let currentRoute = this.currentRoute;
|
33
|
-
let hideRoutes = this.
|
34
|
-
let hideSubstates = this.
|
35
|
+
let hideRoutes = this.options.hideRoutes;
|
36
|
+
let hideSubstates = this.options.hideSubstates;
|
35
37
|
|
36
38
|
if (hideRoutes && currentRoute) {
|
37
39
|
return checkCurrentRoute(currentRoute, routeItem.value);
|
@@ -60,8 +62,8 @@ export default class RouteTreeController extends Controller {
|
|
60
62
|
});
|
61
63
|
}
|
62
64
|
|
63
|
-
|
64
|
-
super
|
65
|
+
constructor() {
|
66
|
+
super(...arguments);
|
65
67
|
|
66
68
|
set(this, 'model', []);
|
67
69
|
set(this, 'options', {
|
@@ -15,7 +15,7 @@ const { keys } = Object;
|
|
15
15
|
|
16
16
|
export function buildStyle(_, options) {
|
17
17
|
return htmlSafe(
|
18
|
-
keys(options).reduce((style, key) => `${style}${key}:${options[key]};`, '')
|
18
|
+
keys(options).reduce((style, key) => `${style}${key}:${options[key]};`, ''),
|
19
19
|
);
|
20
20
|
}
|
21
21
|
|
@@ -5,7 +5,7 @@ export default {
|
|
5
5
|
initialize(instance) {
|
6
6
|
// {{EMBER_DIST}} is replaced by the build process (basic, chrome, etc)
|
7
7
|
let Adapter = instance.resolveRegistration(
|
8
|
-
`service:adapters/{{EMBER_DIST}}
|
8
|
+
`service:adapters/{{EMBER_DIST}}`,
|
9
9
|
);
|
10
10
|
|
11
11
|
// register the adapter service
|
@@ -0,0 +1,249 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
2
|
+
import { assert } from '@ember/debug';
|
3
|
+
import { later } from '@ember/runloop';
|
4
|
+
import EmberObject, { action, setProperties } from '@ember/object';
|
5
|
+
import { addListener, removeListener, sendEvent } from '@ember/object/events';
|
6
|
+
import type { AnyFn } from '@ember/-internals/utility-types';
|
7
|
+
|
8
|
+
import { TrackedArray, TrackedObject } from 'tracked-built-ins';
|
9
|
+
import { tracked } from '@glimmer/tracking';
|
10
|
+
|
11
|
+
import PromiseModel from '../models/promise';
|
12
|
+
import type PortService from '../services/port';
|
13
|
+
|
14
|
+
interface SerializedPromise {
|
15
|
+
children?: Array<string>;
|
16
|
+
guid: string;
|
17
|
+
label: string;
|
18
|
+
parent?: string;
|
19
|
+
reason: string;
|
20
|
+
state: string;
|
21
|
+
value: string;
|
22
|
+
}
|
23
|
+
|
24
|
+
export default class PromiseAssembler extends EmberObject {
|
25
|
+
declare port: PortService;
|
26
|
+
// Used to track whether current message received
|
27
|
+
// is the first in the request
|
28
|
+
// Mainly helps in triggering 'firstMessageReceived' event
|
29
|
+
@tracked firstMessageReceived = false;
|
30
|
+
|
31
|
+
all = new TrackedArray<PromiseModel>([]);
|
32
|
+
promiseIndex = new TrackedObject<Record<string, number>>({});
|
33
|
+
topSort = new TrackedArray<PromiseModel>([]);
|
34
|
+
topSortMeta = new TrackedObject<Record<string, { hasParent?: boolean }>>({});
|
35
|
+
|
36
|
+
start() {
|
37
|
+
this.port.on('promise:promisesUpdated', this, this.addOrUpdatePromises);
|
38
|
+
this.port.send('promise:getAndObservePromises');
|
39
|
+
}
|
40
|
+
|
41
|
+
stop() {
|
42
|
+
this.port.off('promise:promisesUpdated', this, this.addOrUpdatePromises);
|
43
|
+
this.port.send('promise:releasePromises');
|
44
|
+
this.reset();
|
45
|
+
}
|
46
|
+
|
47
|
+
reset() {
|
48
|
+
this.topSortMeta = new TrackedObject<
|
49
|
+
Record<string, { hasParent?: boolean }>
|
50
|
+
>({});
|
51
|
+
this.promiseIndex = new TrackedObject<Record<string, number>>({});
|
52
|
+
this.topSort.splice(0, this.topSort.length);
|
53
|
+
|
54
|
+
this.firstMessageReceived = false;
|
55
|
+
const all = this.all;
|
56
|
+
// Lazily destroy promises
|
57
|
+
// Allows for a smooth transition on deactivate,
|
58
|
+
// and thus providing the illusion of better perf
|
59
|
+
// eslint-disable-next-line ember/no-runloop
|
60
|
+
later(
|
61
|
+
this,
|
62
|
+
function () {
|
63
|
+
this.destroyPromises(all);
|
64
|
+
},
|
65
|
+
500,
|
66
|
+
);
|
67
|
+
this.all = new TrackedArray([]);
|
68
|
+
}
|
69
|
+
|
70
|
+
destroyPromises(promises: Array<EmberObject>) {
|
71
|
+
promises.forEach(function (item) {
|
72
|
+
item.destroy();
|
73
|
+
});
|
74
|
+
}
|
75
|
+
|
76
|
+
addOrUpdatePromises = (message: { promises: Array<SerializedPromise> }) => {
|
77
|
+
this.rebuildPromises(message.promises);
|
78
|
+
|
79
|
+
if (!this.firstMessageReceived) {
|
80
|
+
this.firstMessageReceived = true;
|
81
|
+
this.trigger('firstMessageReceived');
|
82
|
+
}
|
83
|
+
};
|
84
|
+
|
85
|
+
rebuildPromises = (promises: Array<SerializedPromise | PromiseModel>) => {
|
86
|
+
promises.forEach((props) => {
|
87
|
+
props = Object.assign({}, props);
|
88
|
+
const childrenIds = props.children;
|
89
|
+
const parentId = props.parent;
|
90
|
+
delete props.children;
|
91
|
+
delete props.parent;
|
92
|
+
if (parentId && parentId !== props.guid) {
|
93
|
+
props.parent = this.updateOrCreate({ guid: parentId });
|
94
|
+
}
|
95
|
+
const promise = this.updateOrCreate(props);
|
96
|
+
if (childrenIds) {
|
97
|
+
childrenIds.forEach((childId) => {
|
98
|
+
// avoid infinite recursion
|
99
|
+
if (childId === props.guid) {
|
100
|
+
return;
|
101
|
+
}
|
102
|
+
const child = this.updateOrCreate({ guid: childId, parent: promise });
|
103
|
+
promise.children.push(child);
|
104
|
+
});
|
105
|
+
}
|
106
|
+
});
|
107
|
+
};
|
108
|
+
|
109
|
+
updateTopSort = (promise: PromiseModel) => {
|
110
|
+
const topSortMeta = this.topSortMeta;
|
111
|
+
const guid = promise.guid;
|
112
|
+
let meta = topSortMeta[guid] ?? {};
|
113
|
+
const isNew = !meta;
|
114
|
+
let hadParent: boolean | undefined = false;
|
115
|
+
const hasParent = !!promise.parent;
|
116
|
+
const topSort = this.topSort;
|
117
|
+
let parentChanged = isNew;
|
118
|
+
|
119
|
+
if (isNew) {
|
120
|
+
meta = topSortMeta[guid] = {};
|
121
|
+
} else {
|
122
|
+
hadParent = meta.hasParent;
|
123
|
+
}
|
124
|
+
if (!isNew && hasParent !== hadParent) {
|
125
|
+
// todo: implement recursion to reposition children
|
126
|
+
const index = topSort.indexOf(promise);
|
127
|
+
if (index !== -1) {
|
128
|
+
topSort.splice(index, 1);
|
129
|
+
}
|
130
|
+
parentChanged = true;
|
131
|
+
}
|
132
|
+
meta.hasParent = hasParent;
|
133
|
+
if (parentChanged) {
|
134
|
+
this.insertInTopSort(promise);
|
135
|
+
}
|
136
|
+
};
|
137
|
+
|
138
|
+
insertInTopSort = (promise: PromiseModel) => {
|
139
|
+
const topSort = this.topSort;
|
140
|
+
if (promise.parent) {
|
141
|
+
const parentIndex = topSort.indexOf(promise.parent);
|
142
|
+
topSort.splice(parentIndex + 1, 0, promise);
|
143
|
+
} else {
|
144
|
+
this.topSort.push(promise);
|
145
|
+
}
|
146
|
+
promise.children.forEach((child) => {
|
147
|
+
const index = topSort.indexOf(child);
|
148
|
+
if (index !== -1) {
|
149
|
+
topSort.splice(index, 1);
|
150
|
+
}
|
151
|
+
this.insertInTopSort(child);
|
152
|
+
});
|
153
|
+
};
|
154
|
+
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
156
|
+
updateOrCreate = (props: any) => {
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
158
|
+
const guid = props.guid;
|
159
|
+
const promise = this.findOrCreate(guid);
|
160
|
+
|
161
|
+
setProperties(promise, props);
|
162
|
+
|
163
|
+
this.updateTopSort(promise);
|
164
|
+
|
165
|
+
return promise;
|
166
|
+
};
|
167
|
+
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
169
|
+
createPromise(props: any): PromiseModel {
|
170
|
+
const promise = PromiseModel.create(props) as PromiseModel;
|
171
|
+
const index = this.all.length;
|
172
|
+
|
173
|
+
this.all.push(promise);
|
174
|
+
this.promiseIndex[promise.guid as keyof object] = index;
|
175
|
+
return promise;
|
176
|
+
}
|
177
|
+
|
178
|
+
find(guid?: string) {
|
179
|
+
if (guid) {
|
180
|
+
const index = this.promiseIndex[guid as keyof object];
|
181
|
+
if (index !== undefined) {
|
182
|
+
return this.all.at(index);
|
183
|
+
}
|
184
|
+
} else {
|
185
|
+
return this.all;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
findOrCreate(guid?: string) {
|
190
|
+
if (!guid) {
|
191
|
+
assert('You have tried to findOrCreate without a guid');
|
192
|
+
}
|
193
|
+
return (this.find(guid) as PromiseModel) || this.createPromise({ guid });
|
194
|
+
}
|
195
|
+
|
196
|
+
// Manually implement Evented functionality, so we can move away from the mixin
|
197
|
+
|
198
|
+
on(eventName: string, method: AnyFn): void;
|
199
|
+
on(eventName: string, target: unknown, method: AnyFn): void;
|
200
|
+
|
201
|
+
@action
|
202
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
203
|
+
on(eventName: string, targetOrMethod: unknown | AnyFn, method?: AnyFn): void {
|
204
|
+
if (typeof targetOrMethod === 'function') {
|
205
|
+
// If we did not pass a target, default to `this`
|
206
|
+
addListener(this, eventName, this, targetOrMethod as AnyFn);
|
207
|
+
} else {
|
208
|
+
addListener(this, eventName, targetOrMethod as object, method);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
one(eventName: string, method: AnyFn): void;
|
213
|
+
one(eventName: string, target: unknown, method: AnyFn): void;
|
214
|
+
|
215
|
+
@action
|
216
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
217
|
+
one(eventName: string, targetOrMethod: unknown | AnyFn, method?: AnyFn) {
|
218
|
+
if (typeof targetOrMethod === 'function') {
|
219
|
+
// If we did not pass a target, default to `this`
|
220
|
+
addListener(this, eventName, this, targetOrMethod as AnyFn, true);
|
221
|
+
} else {
|
222
|
+
addListener(this, eventName, targetOrMethod as object, method, true);
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
off(eventName: string, method: AnyFn): void;
|
227
|
+
off(eventName: string, target: unknown, method: AnyFn): void;
|
228
|
+
|
229
|
+
@action
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
231
|
+
off(eventName: string, targetOrMethod: unknown | AnyFn, method?: AnyFn) {
|
232
|
+
try {
|
233
|
+
if (typeof targetOrMethod === 'function') {
|
234
|
+
// If we did not pass a target, default to `this`
|
235
|
+
removeListener(this, eventName, this, targetOrMethod as AnyFn);
|
236
|
+
} else {
|
237
|
+
removeListener(this, eventName, targetOrMethod as object, method);
|
238
|
+
}
|
239
|
+
} catch (e) {
|
240
|
+
console.error(e);
|
241
|
+
}
|
242
|
+
}
|
243
|
+
|
244
|
+
@action
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
246
|
+
trigger(eventName: string, ...args: Array<any>) {
|
247
|
+
sendEvent(this, eventName, args);
|
248
|
+
}
|
249
|
+
}
|
@@ -81,7 +81,7 @@ export default class {
|
|
81
81
|
let saved = this.storage.getItem(this.getStorageKey());
|
82
82
|
if (saved && saved.columnVisibility) {
|
83
83
|
let savedIds = keys(saved.columnVisibility).sort();
|
84
|
-
let schemaIds = this.columnSchema.
|
84
|
+
let schemaIds = this.columnSchema.map((col) => col.id).sort();
|
85
85
|
if (!compareArrays(savedIds, schemaIds)) {
|
86
86
|
// Clear saved items
|
87
87
|
this.storage.removeItem(this.getStorageKey());
|
@@ -165,7 +165,7 @@ export default class {
|
|
165
165
|
if (saved.columnVisibility && !isNone(saved.columnVisibility[id])) {
|
166
166
|
return saved.columnVisibility[id];
|
167
167
|
}
|
168
|
-
return this.columnSchema.
|
168
|
+
return this.columnSchema.find((x) => x.id === id).visible;
|
169
169
|
}
|
170
170
|
|
171
171
|
/**
|
@@ -195,7 +195,7 @@ export default class {
|
|
195
195
|
this._columnVisibility = this.columnSchema.map((column) =>
|
196
196
|
Object.assign({}, column, {
|
197
197
|
visible: this.isColumnVisible(column.id),
|
198
|
-
})
|
198
|
+
}),
|
199
199
|
);
|
200
200
|
}
|
201
201
|
|
@@ -221,8 +221,8 @@ export default class {
|
|
221
221
|
let diff = this.tableWidth - totalWidth;
|
222
222
|
while (diff > 0) {
|
223
223
|
columns
|
224
|
-
.
|
225
|
-
.
|
224
|
+
.filter((col) => !!col.visible)
|
225
|
+
.sort((a, b) => a.width - b.width)
|
226
226
|
.forEach((column) => {
|
227
227
|
if (diff > 0) {
|
228
228
|
column.width++;
|
@@ -245,7 +245,7 @@ export default class {
|
|
245
245
|
* @param {Number} width The column's new width
|
246
246
|
*/
|
247
247
|
updateColumnWidth(id, width) {
|
248
|
-
let column = this._columns.
|
248
|
+
let column = this._columns.find((x) => x.id === id);
|
249
249
|
let previousWidth = column.width;
|
250
250
|
column.width = width;
|
251
251
|
let last = this._columns[this._columns.length - 1];
|
@@ -265,9 +265,9 @@ export default class {
|
|
265
265
|
* @param {String} id
|
266
266
|
*/
|
267
267
|
toggleVisibility(id) {
|
268
|
-
let column = this._columnVisibility.
|
268
|
+
let column = this._columnVisibility.find((x) => x.id === id);
|
269
269
|
column.visible = !column.visible;
|
270
|
-
if (!this._columnVisibility.
|
270
|
+
if (!this._columnVisibility.some((col) => col.visible)) {
|
271
271
|
// If this column was the last visible column
|
272
272
|
// cancel toggling and set back to `true`.
|
273
273
|
column.visible = true;
|
@@ -317,7 +317,7 @@ export default class {
|
|
317
317
|
obj[id] = visible;
|
318
318
|
return obj;
|
319
319
|
},
|
320
|
-
{}
|
320
|
+
{},
|
321
321
|
);
|
322
322
|
this.storage.setItem(this.getStorageKey(), saved);
|
323
323
|
}
|
@@ -362,7 +362,7 @@ export default class {
|
|
362
362
|
* @method getStorageKey
|
363
363
|
*/
|
364
364
|
getStorageKey() {
|
365
|
-
return `
|
365
|
+
return `list-${this.key}`;
|
366
366
|
}
|
367
367
|
|
368
368
|
/**
|