@ng-doc/builder 22.0.0-beta.1 → 22.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/README.md +19 -28
- package/application/index.js +7 -2
- package/application/index.js.map +1 -1
- package/application/schema.json +11 -4
- package/builders.json +23 -13
- package/classes/observable-map.d.ts +1 -0
- package/classes/observable-map.js +14 -3
- package/classes/observable-map.js.map +1 -1
- package/classes/observable-set.js +2 -1
- package/classes/observable-set.js.map +1 -1
- package/dev-server/index.js +5 -3
- package/dev-server/index.js.map +1 -1
- package/engine/build-ng-doc.js +1 -16
- package/engine/build-ng-doc.js.map +1 -1
- package/engine/builders/api-list/api-list-component.builder.js +4 -4
- package/engine/builders/api-list/api-list-component.builder.js.map +1 -1
- package/engine/builders/api-list/api-page-template.builder.js +2 -2
- package/engine/builders/api-list/api-page-template.builder.js.map +1 -1
- package/engine/builders/global/keywords.builder.d.ts +1 -4
- package/engine/builders/global/keywords.builder.js +5 -9
- package/engine/builders/global/keywords.builder.js.map +1 -1
- package/engine/builders/global/search-indexes.builder.js +1 -1
- package/engine/builders/global/search-indexes.builder.js.map +1 -1
- package/engine/builders/helpers/create-entry-metadata.js +2 -1
- package/engine/builders/helpers/create-entry-metadata.js.map +1 -1
- package/engine/builders/helpers/create-import-path.js.map +1 -1
- package/engine/builders/helpers/get-entry-relative-path.js.map +1 -1
- package/engine/builders/page/demo-assets.builder.js +8 -5
- package/engine/builders/page/demo-assets.builder.js.map +1 -1
- package/engine/builders/page/playground.builder.js +1 -0
- package/engine/builders/page/playground.builder.js.map +1 -1
- package/engine/builders/shared/content.builder.js +3 -3
- package/engine/builders/shared/content.builder.js.map +1 -1
- package/engine/builders/shared/entry.builder.js +1 -13
- package/engine/builders/shared/entry.builder.js.map +1 -1
- package/engine/builders/shared/page-component.builder.js +16 -6
- package/engine/builders/shared/page-component.builder.js.map +1 -1
- package/engine/builders/shared/page-wrapper.builder.js +8 -5
- package/engine/builders/shared/page-wrapper.builder.js.map +1 -1
- package/engine/core/operators/distinct-pending.js.map +1 -1
- package/engine/core/operators/entries-emitter.js +2 -6
- package/engine/core/operators/entries-emitter.js.map +1 -1
- package/engine/core/operators/factory.js +1 -4
- package/engine/core/operators/factory.js.map +1 -1
- package/engine/core/operators/merge-factory.js +19 -17
- package/engine/core/operators/merge-factory.js.map +1 -1
- package/engine/core/operators/when-builders-done.js.map +1 -1
- package/engine/core/stores/index.d.ts +0 -1
- package/engine/core/stores/index.js +0 -1
- package/engine/core/stores/index.js.map +1 -1
- package/engine/core/triggers/on-dependencies-change.d.ts +1 -1
- package/engine/core/triggers/on-dependencies-change.js +2 -2
- package/engine/core/triggers/on-dependencies-change.js.map +1 -1
- package/engine/core/watcher/watch.js +19 -1
- package/engine/core/watcher/watch.js.map +1 -1
- package/engine/variables.d.ts +1 -0
- package/engine/variables.js +1 -0
- package/engine/variables.js.map +1 -1
- package/generator/artifacts/index.d.ts +317 -0
- package/generator/bootstrap/bin.d.ts +18 -0
- package/generator/bootstrap/bin.js +7274 -0
- package/generator/bootstrap/candidate-output-committer.d.ts +12 -0
- package/generator/bootstrap/cli.d.ts +42 -0
- package/generator/bootstrap/cli.js +7123 -0
- package/generator/bootstrap/constants.d.ts +4 -0
- package/generator/bootstrap/index.d.ts +111 -0
- package/generator/bootstrap/index.js +5020 -0
- package/generator/bootstrap/prerender-command.d.ts +31 -0
- package/generator/bootstrap/process-tree.d.ts +49 -0
- package/generator/build-metafile.json +11701 -0
- package/generator/build-provenance.json +119 -0
- package/generator/compiler/assemble.d.ts +41 -0
- package/generator/compiler/classify.d.ts +161 -0
- package/generator/compiler/closure-store.d.ts +55 -0
- package/generator/compiler/common.d.ts +32 -0
- package/generator/compiler/describe.d.ts +21 -0
- package/generator/compiler/dry-run.d.ts +108 -0
- package/generator/compiler/fast-start.d.ts +104 -0
- package/generator/compiler/fold.d.ts +116 -0
- package/generator/compiler/index.d.ts +111 -0
- package/generator/compiler/index.js +17759 -0
- package/generator/compiler/link.d.ts +38 -0
- package/generator/compiler/memo.d.ts +44 -0
- package/generator/compiler/plan.d.ts +92 -0
- package/generator/compiler/progress.d.ts +54 -0
- package/generator/compiler/render.d.ts +27 -0
- package/generator/compiler/retention.d.ts +181 -0
- package/generator/compiler/semantic-closure.d.ts +46 -0
- package/generator/compiler/targeted.d.ts +280 -0
- package/generator/content/content-compiler.d.ts +118 -0
- package/generator/content/highlight-cache.d.ts +139 -0
- package/generator/content/html-pipeline.d.ts +170 -0
- package/generator/content/html-pool.d.ts +239 -0
- package/generator/content/html-worker.js +1598 -0
- package/generator/content-module-ids.d.ts +8 -0
- package/generator/contracts.d.ts +1063 -0
- package/generator/contracts.js +15 -0
- package/generator/discovery/index.d.ts +77 -0
- package/generator/graph/index.d.ts +211 -0
- package/generator/graph/unit-index.d.ts +216 -0
- package/generator/kernel/canonical.d.ts +57 -0
- package/generator/kernel/flags.d.ts +49 -0
- package/generator/kernel/footprint.d.ts +88 -0
- package/generator/kernel/observations.d.ts +68 -0
- package/generator/kernel/paths.d.ts +22 -0
- package/generator/kernel/runtime-identity.d.ts +11 -0
- package/generator/outputs/index.d.ts +67 -0
- package/generator/package.json +3 -0
- package/generator/progress/ci.d.ts +22 -0
- package/generator/progress/detect.d.ts +60 -0
- package/generator/progress/events.d.ts +126 -0
- package/generator/progress/format.d.ts +83 -0
- package/generator/progress/gate.d.ts +49 -0
- package/generator/progress/host.d.ts +29 -0
- package/generator/progress/lines.d.ts +42 -0
- package/generator/progress/live.d.ts +115 -0
- package/generator/progress/model.d.ts +85 -0
- package/generator/progress/reporter.d.ts +87 -0
- package/generator/progress/settings.d.ts +60 -0
- package/generator/semantic/angular.d.ts +9 -0
- package/generator/semantic/api-enumeration.d.ts +19 -0
- package/generator/semantic/api-summary.d.ts +33 -0
- package/generator/semantic/dependencies.d.ts +20 -0
- package/generator/semantic/derived-classes.d.ts +58 -0
- package/generator/semantic/documentation-cache.d.ts +23 -0
- package/generator/semantic/fragments.d.ts +28 -0
- package/generator/semantic/owned-roots.d.ts +59 -0
- package/generator/semantic/program-builder.d.ts +55 -0
- package/generator/semantic/program-index.d.ts +124 -0
- package/generator/semantic/program-inputs.d.ts +26 -0
- package/generator/semantic/program-observations.d.ts +158 -0
- package/generator/semantic/program-retention.d.ts +147 -0
- package/generator/semantic/program-state.d.ts +196 -0
- package/generator/semantic/program-verify.d.ts +22 -0
- package/generator/semantic/recorder.d.ts +89 -0
- package/generator/semantic/rendering.d.ts +34 -0
- package/generator/semantic/semantic-closure.d.ts +129 -0
- package/generator/semantic/semantic-service.d.ts +186 -0
- package/generator/semantic/type-text.d.ts +5 -0
- package/generator/session/build-session.d.ts +206 -0
- package/generator/session/input-verification.d.ts +38 -0
- package/generator/session/parcel-event-source.d.ts +22 -0
- package/generator/session/progress.d.ts +72 -0
- package/generator/session/unchanged-saves.d.ts +63 -0
- package/generator/session/watch-inputs.d.ts +6 -0
- package/generator/session/watch-signals.d.ts +10 -0
- package/generator/templates/api/base.html.nunj +26 -0
- package/generator/templates/api/class-declaration.html.nunj +57 -0
- package/generator/templates/api/details/class-declaration.html.nunj +47 -0
- package/generator/templates/api/details/enum-declaration.html.nunj +0 -0
- package/generator/templates/api/details/function-declaration.html.nunj +14 -0
- package/generator/templates/api/details/helpers/decorators.html.nunj +14 -0
- package/generator/templates/api/details/helpers/extends.html.nunj +6 -0
- package/generator/templates/api/details/helpers/selectors.html.nunj +12 -0
- package/generator/templates/api/details/helpers/type-parameters.html.nunj +14 -0
- package/generator/templates/api/details/interface-declaration.html.nunj +27 -0
- package/generator/templates/api/details/type-alias-declaration.html.nunj +14 -0
- package/generator/templates/api/details/variable-declaration.html.nunj +0 -0
- package/generator/templates/api/details.html.nunj +9 -0
- package/generator/templates/api/enum-declaration.html.nunj +12 -0
- package/generator/templates/api/function-declaration.html.nunj +35 -0
- package/generator/templates/api/interface-declaration.html.nunj +37 -0
- package/generator/templates/api/type-alias-declaration.html.nunj +16 -0
- package/generator/templates/api/variable-declaration.html.nunj +8 -0
- package/generator/templates/api-header.html.nunj +11 -0
- package/generator/templates/api-list.ts.nunj +22 -0
- package/generator/templates/api-page-content.html.nunj +1 -0
- package/generator/templates/api-scope.ts.nunj +22 -0
- package/generator/templates/category.ts.nunj +22 -0
- package/generator/templates/code.html.nunj +3 -0
- package/generator/templates/context.ts.nunj +55 -0
- package/generator/templates/demo-assets.ts.nunj +25 -0
- package/generator/templates/helpers/accessor.html.nunj +76 -0
- package/generator/templates/helpers/accessors.html.nunj +7 -0
- package/generator/templates/helpers/badge.html.nunj +4 -0
- package/generator/templates/helpers/call-signature.html.nunj +70 -0
- package/generator/templates/helpers/code.html.nunj +3 -0
- package/generator/templates/helpers/constructor.html.nunj +32 -0
- package/generator/templates/helpers/declaration-modifiers.html.nunj +45 -0
- package/generator/templates/helpers/decorators.html.nunj +11 -0
- package/generator/templates/helpers/members.html.nunj +29 -0
- package/generator/templates/helpers/method.html.nunj +89 -0
- package/generator/templates/helpers/methods.html.nunj +7 -0
- package/generator/templates/helpers/modifier.html.nunj +4 -0
- package/generator/templates/helpers/no-content.html.nunj +3 -0
- package/generator/templates/helpers/overload.html.nunj +57 -0
- package/generator/templates/helpers/parameters.html.nunj +44 -0
- package/generator/templates/helpers/properties.html.nunj +61 -0
- package/generator/templates/helpers/status.html.nunj +33 -0
- package/generator/templates/helpers/tag.html.nunj +4 -0
- package/generator/templates/helpers/type.html.nunj +11 -0
- package/generator/templates/index.ts.nunj +2 -0
- package/generator/templates/page-header.html.nunj +5 -0
- package/generator/templates/page-wrapper.ts.nunj +64 -0
- package/generator/templates/page.ts.nunj +97 -0
- package/generator/templates/parts/examples.html.nunj +11 -0
- package/generator/templates/parts/member-examples.html.nunj +12 -0
- package/generator/templates/parts/member-remarks.html.nunj +8 -0
- package/generator/templates/parts/page-tags.html.nunj +10 -0
- package/generator/templates/parts/remarks.html.nunj +10 -0
- package/generator/templates/parts/see-also.html.nunj +23 -0
- package/generator/templates/parts/usage-notes.html.nunj +8 -0
- package/generator/templates/playgrounds.ts.nunj +63 -0
- package/generator/templates/routes.ts.nunj +49 -0
- package/generator/templates/symbol/decorators.html.nunj +12 -0
- package/generator/templates/symbol/details.html.nunj +62 -0
- package/generator/templates/symbol/extended-by.html.nunj +17 -0
- package/generator/templates/symbol/header.html.nunj +22 -0
- package/generator/templates/symbol/members.html.nunj +301 -0
- package/generator/templates/symbol/page.html.nunj +76 -0
- package/generator/templates/symbol/see-also.html.nunj +16 -0
- package/generator/vite/angular/ANALOG-LICENSE +21 -0
- package/generator/vite/angular/analog-provenance.json +880 -0
- package/generator/vite/angular/index.d.ts +14 -0
- package/generator/vite/angular/index.js +7300 -0
- package/generator/vite/angular-compatibility.d.ts +6 -0
- package/generator/vite/angular-composition.d.ts +68 -0
- package/generator/vite/angular-version.d.ts +38 -0
- package/generator/vite/application-builder.js +331 -0
- package/generator/vite/application-builder.schema.json +46 -0
- package/generator/vite/application.d.ts +91 -0
- package/generator/vite/assets.d.ts +11 -0
- package/generator/vite/bounded-close.d.ts +33 -0
- package/generator/vite/component-updates.d.ts +21 -0
- package/generator/vite/configuration.d.ts +3 -0
- package/generator/vite/dev-server-builder.js +334 -0
- package/generator/vite/dev-server-builder.schema.json +27 -0
- package/generator/vite/dev-styles.d.ts +65 -0
- package/generator/vite/diagnostics.d.ts +4 -0
- package/generator/vite/external-probes.d.ts +40 -0
- package/generator/vite/host-updates.d.ts +145 -0
- package/generator/vite/index.d.ts +13 -0
- package/generator/vite/index.js +11589 -0
- package/generator/vite/lease.d.ts +6 -0
- package/generator/vite/lifecycle.d.ts +119 -0
- package/generator/vite/mime.d.ts +2 -0
- package/generator/vite/missing-paths.d.ts +44 -0
- package/generator/vite/options.d.ts +87 -0
- package/generator/vite/output-watch.d.ts +41 -0
- package/generator/vite/paths.d.ts +7 -0
- package/generator/vite/plugin.d.ts +3 -0
- package/generator/vite/prerender-entry.js +395 -0
- package/generator/vite/prerender-runtime.d.ts +66 -0
- package/generator/vite/prerender.d.ts +27 -0
- package/generator/vite/production.d.ts +66 -0
- package/generator/vite/progress.d.ts +33 -0
- package/generator/vite/restore-theme.js +13 -0
- package/generator/vite/route-inventory.d.ts +24 -0
- package/generator/vite/ssr-renderer-control.d.ts +1 -0
- package/generator/vite/ssr-renderer-entry.js +444 -0
- package/generator/vite/ssr-renderer-protocol.d.ts +101 -0
- package/generator/vite/ssr-renderer.d.ts +74 -0
- package/generator/vite/theme-index.d.ts +13 -0
- package/generator/vite/tsconfig-paths.d.ts +64 -0
- package/generator/vite/vite-event-source.d.ts +198 -0
- package/generator/vite/vite-version.d.ts +26 -0
- package/generator/vite/watch-inputs.d.ts +39 -0
- package/generator/worker/entry.d.ts +1 -0
- package/generator/worker/entry.js +614 -0
- package/generator/worker/index.d.ts +156 -0
- package/generator/worker/index.js +1030 -0
- package/generator/worker/protocol.d.ts +160 -0
- package/helpers/angular/get-component-decorator.js +6 -6
- package/helpers/angular/get-component-decorator.js.map +1 -1
- package/helpers/angular/get-directive-decorator.js +3 -3
- package/helpers/angular/get-directive-decorator.js.map +1 -1
- package/helpers/angular/get-pipe-decorator.js +3 -3
- package/helpers/angular/get-pipe-decorator.js.map +1 -1
- package/helpers/build-indexes.js +5 -2
- package/helpers/build-indexes.js.map +1 -1
- package/helpers/construct-page-keyword.js +2 -1
- package/helpers/construct-page-keyword.js.map +1 -1
- package/helpers/extract-selectors.d.ts +1 -1
- package/helpers/extract-selectors.js +5 -3
- package/helpers/extract-selectors.js.map +1 -1
- package/helpers/filter-useless-members.d.ts +1 -1
- package/helpers/format-code.d.ts +2 -1
- package/helpers/format-code.js +13 -4
- package/helpers/format-code.js.map +1 -1
- package/helpers/import-fresh-esm.js.map +1 -1
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +2 -0
- package/helpers/index.js.map +1 -1
- package/helpers/keyword-heading-title.d.ts +7 -0
- package/helpers/keyword-heading-title.js +21 -0
- package/helpers/keyword-heading-title.js.map +1 -0
- package/helpers/markdown-to-html.js +3 -3
- package/helpers/markdown-to-html.js.map +1 -1
- package/helpers/navigation-title-order.d.ts +8 -0
- package/helpers/navigation-title-order.js +15 -0
- package/helpers/navigation-title-order.js.map +1 -0
- package/helpers/playground/get-playground-inputs.js +8 -4
- package/helpers/playground/get-playground-inputs.js.map +1 -1
- package/helpers/playground/get-playground-template-inputs.js +2 -1
- package/helpers/playground/get-playground-template-inputs.js.map +1 -1
- package/helpers/presentation.d.ts +7 -7
- package/helpers/presentation.js +23 -23
- package/helpers/presentation.js.map +1 -1
- package/helpers/print.js +32 -5
- package/helpers/print.js.map +1 -1
- package/helpers/process-snippets.d.ts +1 -1
- package/helpers/process-snippets.js +3 -3
- package/helpers/process-snippets.js.map +1 -1
- package/helpers/snippets-from-asset.d.ts +1 -1
- package/helpers/snippets-from-asset.js +2 -2
- package/helpers/snippets-from-asset.js.map +1 -1
- package/helpers/sort-navigation-entities.js +2 -1
- package/helpers/sort-navigation-entities.js.map +1 -1
- package/helpers/stable-generated-id.d.ts +2 -0
- package/helpers/stable-generated-id.js +12 -0
- package/helpers/stable-generated-id.js.map +1 -0
- package/helpers/text-order.d.ts +8 -0
- package/helpers/text-order.js +26 -0
- package/helpers/text-order.js.map +1 -0
- package/helpers/typescript/member/get-inherited-parent.d.ts +1 -1
- package/helpers/typescript/member/get-inherited-parent.js +2 -2
- package/helpers/typescript/member/get-inherited-parent.js.map +1 -1
- package/helpers/typescript/node/sort-by-nodes-name.d.ts +4 -2
- package/helpers/typescript/node/sort-by-nodes-name.js +6 -3
- package/helpers/typescript/node/sort-by-nodes-name.js.map +1 -1
- package/helpers/typescript/property/get-property-assignment.js.map +1 -1
- package/interfaces/schema.d.ts +1 -0
- package/package.json +87 -30
- package/parsers/helpers/number.d.ts +1 -1
- package/parsers/helpers/number.js +2 -2
- package/parsers/helpers/number.js.map +1 -1
- package/parsers/helpers/param-value.d.ts +1 -1
- package/parsers/helpers/param-value.js +2 -2
- package/parsers/helpers/param-value.js.map +1 -1
- package/parsers/helpers/param.js +3 -3
- package/parsers/helpers/param.js.map +1 -1
- package/parsers/parse-code-block-params.d.ts +1 -1
- package/parsers/parse-code-block-params.js +22 -16
- package/parsers/parse-code-block-params.js.map +1 -1
- package/parsers/parse-snippet.js +10 -10
- package/parsers/parse-snippet.js.map +1 -1
- package/schematics/collection.json +34 -23
- package/schematics/migrate-to-vite/analyze.d.ts +76 -0
- package/schematics/migrate-to-vite/analyze.js +816 -0
- package/schematics/migrate-to-vite/analyze.js.map +1 -0
- package/schematics/migrate-to-vite/index.d.ts +9 -0
- package/schematics/migrate-to-vite/index.js +585 -0
- package/schematics/migrate-to-vite/index.js.map +1 -0
- package/schematics/migrate-to-vite/legacy-folder.d.ts +84 -0
- package/schematics/migrate-to-vite/legacy-folder.js +340 -0
- package/schematics/migrate-to-vite/legacy-folder.js.map +1 -0
- package/schematics/migrate-to-vite/report.d.ts +32 -0
- package/schematics/migrate-to-vite/report.js +97 -0
- package/schematics/migrate-to-vite/report.js.map +1 -0
- package/schematics/migrate-to-vite/schema.d.ts +13 -0
- package/schematics/migrate-to-vite/schema.js +3 -0
- package/schematics/migrate-to-vite/schema.js.map +1 -0
- package/schematics/migrate-to-vite/schema.json +31 -0
- package/schematics/migrate-to-vite/setup/dependencies.d.ts +64 -0
- package/schematics/migrate-to-vite/setup/dependencies.js +183 -0
- package/schematics/migrate-to-vite/setup/dependencies.js.map +1 -0
- package/schematics/migrate-to-vite/setup/index.d.ts +6 -0
- package/schematics/migrate-to-vite/setup/index.js +13 -0
- package/schematics/migrate-to-vite/setup/index.js.map +1 -0
- package/schematics/migrate-to-vite/setup/json-file.d.ts +51 -0
- package/schematics/migrate-to-vite/setup/json-file.js +115 -0
- package/schematics/migrate-to-vite/setup/json-file.js.map +1 -0
- package/schematics/migrate-to-vite/setup/source.d.ts +30 -0
- package/schematics/migrate-to-vite/setup/source.js +202 -0
- package/schematics/migrate-to-vite/setup/source.js.map +1 -0
- package/schematics/migrate-to-vite/setup/targets.d.ts +51 -0
- package/schematics/migrate-to-vite/setup/targets.js +48 -0
- package/schematics/migrate-to-vite/setup/targets.js.map +1 -0
- package/schematics/migrate-to-vite/setup/vite-config.d.ts +100 -0
- package/schematics/migrate-to-vite/setup/vite-config.js +175 -0
- package/schematics/migrate-to-vite/setup/vite-config.js.map +1 -0
- package/schematics/migrate-to-vite/setup/workspace.d.ts +100 -0
- package/schematics/migrate-to-vite/setup/workspace.js +225 -0
- package/schematics/migrate-to-vite/setup/workspace.js.map +1 -0
- package/schematics/migrate-to-vite/state.d.ts +65 -0
- package/schematics/migrate-to-vite/state.js +92 -0
- package/schematics/migrate-to-vite/state.js.map +1 -0
- package/schematics/migrate-to-vite/testing/fixtures.d.ts +18 -0
- package/schematics/migrate-to-vite/testing/fixtures.js +279 -0
- package/schematics/migrate-to-vite/testing/fixtures.js.map +1 -0
- package/schematics/migrate-to-vite/update-note.d.ts +6 -0
- package/schematics/migrate-to-vite/update-note.js +23 -0
- package/schematics/migrate-to-vite/update-note.js.map +1 -0
- package/schematics/migration.json +5 -0
- package/schematics/migrations/standalone-pages/index.js +7 -6
- package/schematics/migrations/standalone-pages/index.js.map +1 -1
- package/schematics/vite-setup/index.d.ts +20 -0
- package/schematics/vite-setup/index.js +206 -0
- package/schematics/vite-setup/index.js.map +1 -0
- package/schematics/vite-setup/schema.d.ts +7 -0
- package/schematics/vite-setup/schema.js +3 -0
- package/schematics/vite-setup/schema.js.map +1 -0
- package/schematics/vite-setup/schema.json +19 -0
- package/scripts/restore-theme.js +9 -2
- package/templates/context.ts.nunj +3 -0
- package/templates/helpers/badge.html.nunj +1 -1
- package/templates/helpers/status.html.nunj +4 -8
- package/templates/page-wrapper.ts.nunj +24 -1
- package/templates/page.ts.nunj +25 -0
- package/templates/parts/page-tags.html.nunj +1 -1
- package/templates/playgrounds.ts.nunj +8 -9
- package/templates/routes.ts.nunj +6 -1
- package/templates/symbol/decorators.html.nunj +12 -0
- package/templates/symbol/details.html.nunj +62 -0
- package/templates/symbol/extended-by.html.nunj +17 -0
- package/templates/symbol/header.html.nunj +22 -0
- package/templates/symbol/members.html.nunj +301 -0
- package/templates/symbol/page.html.nunj +76 -0
- package/templates/symbol/see-also.html.nunj +16 -0
- package/engine/.cache/apps/ng-doc/docs/api-documentation/auto-generation/ng-doc.page.mjs +0 -20
- package/engine/.cache/apps/ng-doc/docs/api-documentation/documenting-declarations/ng-doc.page.mjs +0 -20
- package/engine/.cache/apps/ng-doc/docs/api-documentation/rendering-api/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/customization/icons/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/customization/layout/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/customization/page-processors/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/customization/page-skeleton/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/customization/search/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/customization/themes/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/develop/ng-doc.page.mjs +0 -36
- package/engine/.cache/apps/ng-doc/docs/getting-started/configuration/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/getting-started/installation/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/getting-started/migrations/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/getting-started/ssr/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/getting-started/what-is-ng-doc/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/ng-doc.api.mjs +0 -42
- package/engine/.cache/apps/ng-doc/docs/recipes/ignoring-file-lines/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/recipes/performance/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/writing-content/blockquotes/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/writing-content/code-blocks/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/writing-content/demo-and-demo-pane/ng-doc.page.mjs +0 -19
- package/engine/.cache/apps/ng-doc/docs/writing-content/images-videos-and-embeds/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/writing-content/keywords/ng-doc.page.mjs +0 -17
- package/engine/.cache/apps/ng-doc/docs/writing-content/mermaid-diagrams/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/writing-content/nunjucks/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/writing-content/pages-and-categories/ng-doc.page.mjs +0 -18
- package/engine/.cache/apps/ng-doc/docs/writing-content/playground/ng-doc.page.mjs +0 -33
- package/engine/core/stores/entry-status.d.ts +0 -23
- package/engine/core/stores/entry-status.js +0 -36
- package/engine/core/stores/entry-status.js.map +0 -1
|
@@ -0,0 +1,1598 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __esm = (fn, res) => function __init() {
|
|
4
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
+
};
|
|
6
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
7
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
8
|
+
};
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// libs/builder/generator/contracts.ts
|
|
15
|
+
var init_contracts = __esm({
|
|
16
|
+
"libs/builder/generator/contracts.ts"() {
|
|
17
|
+
"use strict";
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// libs/builder/generator/kernel/canonical.ts
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
|
+
function compareCodeUnits(left, right) {
|
|
24
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
25
|
+
}
|
|
26
|
+
function sha256Hex(value) {
|
|
27
|
+
return createHash("sha256").update(value).digest("hex");
|
|
28
|
+
}
|
|
29
|
+
function canonicalJson(value) {
|
|
30
|
+
return canonical(value, /* @__PURE__ */ new Set()) ?? "null";
|
|
31
|
+
}
|
|
32
|
+
function canonical(value, path) {
|
|
33
|
+
if (value !== null && typeof value === "object" && typeof value.toJSON === "function")
|
|
34
|
+
value = value.toJSON();
|
|
35
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
36
|
+
if (path.has(value)) throw new TypeError("Converting circular structure to canonical JSON");
|
|
37
|
+
path.add(value);
|
|
38
|
+
let text;
|
|
39
|
+
if (Array.isArray(value)) {
|
|
40
|
+
text = `[${Array.from(value, (item) => canonical(item, path) ?? "null").join(",")}]`;
|
|
41
|
+
} else {
|
|
42
|
+
const fields = [];
|
|
43
|
+
for (const key of Object.keys(value).sort(compareCodeUnits)) {
|
|
44
|
+
const item = canonical(value[key], path);
|
|
45
|
+
if (item !== void 0) fields.push(`${JSON.stringify(key)}:${item}`);
|
|
46
|
+
}
|
|
47
|
+
text = `{${fields.join(",")}}`;
|
|
48
|
+
}
|
|
49
|
+
path.delete(value);
|
|
50
|
+
return text;
|
|
51
|
+
}
|
|
52
|
+
function digestOf(value) {
|
|
53
|
+
return sha256Hex(canonicalJson(value));
|
|
54
|
+
}
|
|
55
|
+
var init_canonical = __esm({
|
|
56
|
+
"libs/builder/generator/kernel/canonical.ts"() {
|
|
57
|
+
"use strict";
|
|
58
|
+
init_contracts();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// libs/builder/generator/worker/protocol.ts
|
|
63
|
+
function encode(value) {
|
|
64
|
+
const result = JSON.stringify(
|
|
65
|
+
value,
|
|
66
|
+
function(key, item) {
|
|
67
|
+
const original = this[key];
|
|
68
|
+
if (typeof item === "function" || typeof item === "symbol" || typeof item === "bigint" || typeof item === "number" && !Number.isFinite(item) || original !== null && typeof original === "object" && !Array.isArray(original) && (Object.getPrototypeOf(original) !== Object.prototype && Object.getPrototypeOf(original) !== null || typeof original.toJSON === "function"))
|
|
69
|
+
throw new Error("Worker transport requires JSON values");
|
|
70
|
+
return item;
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
if (result === void 0) throw new Error("Worker transport requires a JSON value");
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
function decode(value) {
|
|
77
|
+
if (typeof value !== "string") throw new Error("Worker message must be JSON text");
|
|
78
|
+
const parsed = JSON.parse(value);
|
|
79
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
80
|
+
throw new Error("Worker message must be an object");
|
|
81
|
+
}
|
|
82
|
+
return parsed;
|
|
83
|
+
}
|
|
84
|
+
var init_protocol = __esm({
|
|
85
|
+
"libs/builder/generator/worker/protocol.ts"() {
|
|
86
|
+
"use strict";
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// libs/utils/html/minify.ts
|
|
91
|
+
import rehypeMinifyWhitespace from "rehype-minify-whitespace";
|
|
92
|
+
import rehypeParse from "rehype-parse";
|
|
93
|
+
import rehypeStringify from "rehype-stringify";
|
|
94
|
+
import { unified } from "unified";
|
|
95
|
+
function minify(html) {
|
|
96
|
+
return unified().use(rehypeParse, { fragment: true }).use(rehypeStringify).use(rehypeMinifyWhitespace).processSync(html).toString();
|
|
97
|
+
}
|
|
98
|
+
var init_minify = __esm({
|
|
99
|
+
"libs/utils/html/minify.ts"() {
|
|
100
|
+
"use strict";
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// libs/core/constants/angular-entities.ts
|
|
105
|
+
var init_angular_entities = __esm({
|
|
106
|
+
"libs/core/constants/angular-entities.ts"() {
|
|
107
|
+
"use strict";
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// libs/core/constants/declarations.ts
|
|
112
|
+
var init_declarations = __esm({
|
|
113
|
+
"libs/core/constants/declarations.ts"() {
|
|
114
|
+
"use strict";
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// libs/core/constants/defaults.ts
|
|
119
|
+
var NG_DOC_ELEMENT;
|
|
120
|
+
var init_defaults = __esm({
|
|
121
|
+
"libs/core/constants/defaults.ts"() {
|
|
122
|
+
"use strict";
|
|
123
|
+
NG_DOC_ELEMENT = "ngde";
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// libs/core/constants/dynamic-selector.ts
|
|
128
|
+
var init_dynamic_selector = __esm({
|
|
129
|
+
"libs/core/constants/dynamic-selector.ts"() {
|
|
130
|
+
"use strict";
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// libs/core/constants/empty.ts
|
|
135
|
+
var init_empty = __esm({
|
|
136
|
+
"libs/core/constants/empty.ts"() {
|
|
137
|
+
"use strict";
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// libs/core/constants/syntax-theme.ts
|
|
142
|
+
function ngDocSyntaxTheme() {
|
|
143
|
+
return {
|
|
144
|
+
name: NG_DOC_SYNTAX_THEME_NAME,
|
|
145
|
+
type: "light",
|
|
146
|
+
colors: {
|
|
147
|
+
"editor.foreground": syntax("plain"),
|
|
148
|
+
"editor.background": "var(--ng-doc-code-background)"
|
|
149
|
+
},
|
|
150
|
+
// A more specific scope wins over a shorter one, so the order below does not matter.
|
|
151
|
+
tokenColors: [
|
|
152
|
+
{
|
|
153
|
+
scope: ["comment", "punctuation.definition.comment", "string.quoted.docstring"],
|
|
154
|
+
settings: { foreground: syntax("comment"), fontStyle: "italic" }
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
scope: [
|
|
158
|
+
"punctuation",
|
|
159
|
+
"meta.brace",
|
|
160
|
+
"keyword.operator",
|
|
161
|
+
"punctuation.definition.tag",
|
|
162
|
+
"punctuation.definition.template-expression",
|
|
163
|
+
"punctuation.section.embedded"
|
|
164
|
+
],
|
|
165
|
+
settings: { foreground: syntax("punctuation") }
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
scope: [
|
|
169
|
+
"keyword",
|
|
170
|
+
"storage",
|
|
171
|
+
"keyword.operator.new",
|
|
172
|
+
"keyword.operator.expression",
|
|
173
|
+
"keyword.operator.word",
|
|
174
|
+
"variable.language",
|
|
175
|
+
"markup.heading"
|
|
176
|
+
],
|
|
177
|
+
settings: { foreground: syntax("keyword") }
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
scope: [
|
|
181
|
+
"entity.name.type",
|
|
182
|
+
"entity.name.class",
|
|
183
|
+
"entity.name.namespace",
|
|
184
|
+
"entity.other.inherited-class",
|
|
185
|
+
"support.type",
|
|
186
|
+
"support.class",
|
|
187
|
+
"markup.underline.link"
|
|
188
|
+
],
|
|
189
|
+
settings: { foreground: syntax("type") }
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
scope: [
|
|
193
|
+
"entity.name.function",
|
|
194
|
+
"support.function",
|
|
195
|
+
"variable.function",
|
|
196
|
+
"entity.other.attribute-name"
|
|
197
|
+
],
|
|
198
|
+
settings: { foreground: syntax("function") }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
scope: [
|
|
202
|
+
"string",
|
|
203
|
+
"punctuation.definition.string",
|
|
204
|
+
"markup.inline.raw",
|
|
205
|
+
"markup.fenced_code"
|
|
206
|
+
],
|
|
207
|
+
settings: { foreground: syntax("string") }
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
// Code embedded in a string, such as a template literal's `${…}`.
|
|
211
|
+
scope: ["meta.template.expression", "meta.embedded"],
|
|
212
|
+
settings: { foreground: syntax("plain") }
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
scope: [
|
|
216
|
+
"constant.numeric",
|
|
217
|
+
"constant.language",
|
|
218
|
+
"constant.character",
|
|
219
|
+
"constant.other",
|
|
220
|
+
"keyword.other.unit"
|
|
221
|
+
],
|
|
222
|
+
settings: { foreground: syntax("number") }
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
scope: ["entity.name.tag", "support.class.component"],
|
|
226
|
+
settings: { foreground: syntax("tag") }
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
// The `@` and the decorator name; its arguments keep their own colours.
|
|
230
|
+
scope: ["punctuation.decorator", "meta.decorator entity.name.function"],
|
|
231
|
+
settings: { foreground: syntax("decorator") }
|
|
232
|
+
},
|
|
233
|
+
{ scope: ["markup.bold", "markup.heading"], settings: { fontStyle: "bold" } },
|
|
234
|
+
{ scope: ["markup.italic"], settings: { fontStyle: "italic" } }
|
|
235
|
+
]
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
var NG_DOC_SYNTAX_THEME_NAME, syntax;
|
|
239
|
+
var init_syntax_theme = __esm({
|
|
240
|
+
"libs/core/constants/syntax-theme.ts"() {
|
|
241
|
+
"use strict";
|
|
242
|
+
NG_DOC_SYNTAX_THEME_NAME = "css-variables";
|
|
243
|
+
syntax = (token) => `var(--ng-doc-syntax-${token})`;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// libs/core/constants/index.ts
|
|
248
|
+
var init_constants = __esm({
|
|
249
|
+
"libs/core/constants/index.ts"() {
|
|
250
|
+
"use strict";
|
|
251
|
+
init_angular_entities();
|
|
252
|
+
init_declarations();
|
|
253
|
+
init_defaults();
|
|
254
|
+
init_dynamic_selector();
|
|
255
|
+
init_empty();
|
|
256
|
+
init_syntax_theme();
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// libs/core/helpers/is-iterable.ts
|
|
261
|
+
function isIterable(value) {
|
|
262
|
+
return value !== null && typeof value[Symbol.iterator] === "function" && typeof value !== "string";
|
|
263
|
+
}
|
|
264
|
+
var init_is_iterable = __esm({
|
|
265
|
+
"libs/core/helpers/is-iterable.ts"() {
|
|
266
|
+
"use strict";
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// libs/core/helpers/is-present.ts
|
|
271
|
+
function isPresent(value) {
|
|
272
|
+
return value !== void 0 && value !== null && (typeof value !== "string" || value !== "");
|
|
273
|
+
}
|
|
274
|
+
var init_is_present = __esm({
|
|
275
|
+
"libs/core/helpers/is-present.ts"() {
|
|
276
|
+
"use strict";
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// libs/core/helpers/as-array.ts
|
|
281
|
+
function asArray(...items) {
|
|
282
|
+
return items.map((data) => {
|
|
283
|
+
if (!isPresent(data)) {
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
return Array.isArray(data) ? data : isIterable(data) ? Array.from(data) : [data];
|
|
287
|
+
}).flat();
|
|
288
|
+
}
|
|
289
|
+
var init_as_array = __esm({
|
|
290
|
+
"libs/core/helpers/as-array.ts"() {
|
|
291
|
+
"use strict";
|
|
292
|
+
init_is_iterable();
|
|
293
|
+
init_is_present();
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// libs/core/helpers/is-node-tag.ts
|
|
298
|
+
var init_is_node_tag = __esm({
|
|
299
|
+
"libs/core/helpers/is-node-tag.ts"() {
|
|
300
|
+
"use strict";
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// libs/core/helpers/object-keys.ts
|
|
305
|
+
var init_object_keys = __esm({
|
|
306
|
+
"libs/core/helpers/object-keys.ts"() {
|
|
307
|
+
"use strict";
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// libs/core/helpers/build-playground-demo-template.ts
|
|
312
|
+
import * as CSSWhat from "css-what";
|
|
313
|
+
import { SelectorType } from "css-what";
|
|
314
|
+
var init_build_playground_demo_template = __esm({
|
|
315
|
+
"libs/core/helpers/build-playground-demo-template.ts"() {
|
|
316
|
+
"use strict";
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// libs/core/helpers/capitalize.ts
|
|
321
|
+
var init_capitalize = __esm({
|
|
322
|
+
"libs/core/helpers/capitalize.ts"() {
|
|
323
|
+
"use strict";
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
// libs/core/helpers/escape-html.ts
|
|
328
|
+
var init_escape_html = __esm({
|
|
329
|
+
"libs/core/helpers/escape-html.ts"() {
|
|
330
|
+
"use strict";
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
// libs/core/helpers/escape-regexp.ts
|
|
335
|
+
var init_escape_regexp = __esm({
|
|
336
|
+
"libs/core/helpers/escape-regexp.ts"() {
|
|
337
|
+
"use strict";
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
// libs/core/helpers/extract-value.ts
|
|
342
|
+
var init_extract_value = __esm({
|
|
343
|
+
"libs/core/helpers/extract-value.ts"() {
|
|
344
|
+
"use strict";
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// libs/core/helpers/extract-function-defaults.ts
|
|
349
|
+
var init_extract_function_defaults = __esm({
|
|
350
|
+
"libs/core/helpers/extract-function-defaults.ts"() {
|
|
351
|
+
"use strict";
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// libs/core/helpers/get-assigned-inputs.ts
|
|
356
|
+
var init_get_assigned_inputs = __esm({
|
|
357
|
+
"libs/core/helpers/get-assigned-inputs.ts"() {
|
|
358
|
+
"use strict";
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
// libs/core/helpers/is-keyboard-event.ts
|
|
363
|
+
var init_is_keyboard_event = __esm({
|
|
364
|
+
"libs/core/helpers/is-keyboard-event.ts"() {
|
|
365
|
+
"use strict";
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
// libs/core/helpers/is-route.ts
|
|
370
|
+
var init_is_route = __esm({
|
|
371
|
+
"libs/core/helpers/is-route.ts"() {
|
|
372
|
+
"use strict";
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// libs/core/helpers/is-same-object.ts
|
|
377
|
+
var init_is_same_object = __esm({
|
|
378
|
+
"libs/core/helpers/is-same-object.ts"() {
|
|
379
|
+
"use strict";
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// libs/core/helpers/kebab-case.ts
|
|
384
|
+
var init_kebab_case = __esm({
|
|
385
|
+
"libs/core/helpers/kebab-case.ts"() {
|
|
386
|
+
"use strict";
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
// libs/core/helpers/stringify.ts
|
|
391
|
+
var init_stringify = __esm({
|
|
392
|
+
"libs/core/helpers/stringify.ts"() {
|
|
393
|
+
"use strict";
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// libs/core/helpers/uid.ts
|
|
398
|
+
var init_uid = __esm({
|
|
399
|
+
"libs/core/helpers/uid.ts"() {
|
|
400
|
+
"use strict";
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
// libs/core/helpers/unique.ts
|
|
405
|
+
var init_unique = __esm({
|
|
406
|
+
"libs/core/helpers/unique.ts"() {
|
|
407
|
+
"use strict";
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// libs/core/helpers/index.ts
|
|
412
|
+
var init_helpers = __esm({
|
|
413
|
+
"libs/core/helpers/index.ts"() {
|
|
414
|
+
"use strict";
|
|
415
|
+
init_as_array();
|
|
416
|
+
init_build_playground_demo_template();
|
|
417
|
+
init_capitalize();
|
|
418
|
+
init_escape_html();
|
|
419
|
+
init_escape_regexp();
|
|
420
|
+
init_extract_function_defaults();
|
|
421
|
+
init_extract_value();
|
|
422
|
+
init_get_assigned_inputs();
|
|
423
|
+
init_is_iterable();
|
|
424
|
+
init_is_keyboard_event();
|
|
425
|
+
init_is_node_tag();
|
|
426
|
+
init_is_present();
|
|
427
|
+
init_is_route();
|
|
428
|
+
init_is_same_object();
|
|
429
|
+
init_kebab_case();
|
|
430
|
+
init_object_keys();
|
|
431
|
+
init_stringify();
|
|
432
|
+
init_uid();
|
|
433
|
+
init_unique();
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
// libs/core/interfaces/api.ts
|
|
438
|
+
var init_api = __esm({
|
|
439
|
+
"libs/core/interfaces/api.ts"() {
|
|
440
|
+
"use strict";
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// libs/core/interfaces/api-list.ts
|
|
445
|
+
var init_api_list = __esm({
|
|
446
|
+
"libs/core/interfaces/api-list.ts"() {
|
|
447
|
+
"use strict";
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// libs/core/interfaces/api-list-item.ts
|
|
452
|
+
var init_api_list_item = __esm({
|
|
453
|
+
"libs/core/interfaces/api-list-item.ts"() {
|
|
454
|
+
"use strict";
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
// libs/core/interfaces/api-scope.ts
|
|
459
|
+
var init_api_scope = __esm({
|
|
460
|
+
"libs/core/interfaces/api-scope.ts"() {
|
|
461
|
+
"use strict";
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
// libs/core/interfaces/base-entity.ts
|
|
466
|
+
var init_base_entity = __esm({
|
|
467
|
+
"libs/core/interfaces/base-entity.ts"() {
|
|
468
|
+
"use strict";
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
// libs/core/interfaces/category.ts
|
|
473
|
+
var init_category = __esm({
|
|
474
|
+
"libs/core/interfaces/category.ts"() {
|
|
475
|
+
"use strict";
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// libs/core/interfaces/content-module.ts
|
|
480
|
+
var init_content_module = __esm({
|
|
481
|
+
"libs/core/interfaces/content-module.ts"() {
|
|
482
|
+
"use strict";
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
// libs/core/interfaces/demo-options.ts
|
|
487
|
+
var init_demo_options = __esm({
|
|
488
|
+
"libs/core/interfaces/demo-options.ts"() {
|
|
489
|
+
"use strict";
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
// libs/core/interfaces/js-doc-metadata.ts
|
|
494
|
+
var init_js_doc_metadata = __esm({
|
|
495
|
+
"libs/core/interfaces/js-doc-metadata.ts"() {
|
|
496
|
+
"use strict";
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
// libs/core/interfaces/keyword-map.ts
|
|
501
|
+
var KEYWORD_ALLOWED_LANGUAGES;
|
|
502
|
+
var init_keyword_map = __esm({
|
|
503
|
+
"libs/core/interfaces/keyword-map.ts"() {
|
|
504
|
+
"use strict";
|
|
505
|
+
KEYWORD_ALLOWED_LANGUAGES = ["html"];
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// libs/core/interfaces/page.ts
|
|
510
|
+
var init_page = __esm({
|
|
511
|
+
"libs/core/interfaces/page.ts"() {
|
|
512
|
+
"use strict";
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
// libs/core/interfaces/page-anchor.ts
|
|
517
|
+
var init_page_anchor = __esm({
|
|
518
|
+
"libs/core/interfaces/page-anchor.ts"() {
|
|
519
|
+
"use strict";
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
// libs/core/interfaces/page-info.ts
|
|
524
|
+
var init_page_info = __esm({
|
|
525
|
+
"libs/core/interfaces/page-info.ts"() {
|
|
526
|
+
"use strict";
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
// libs/core/interfaces/playground-config.ts
|
|
531
|
+
var init_playground_config = __esm({
|
|
532
|
+
"libs/core/interfaces/playground-config.ts"() {
|
|
533
|
+
"use strict";
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// libs/core/interfaces/playground-content.ts
|
|
538
|
+
var init_playground_content = __esm({
|
|
539
|
+
"libs/core/interfaces/playground-content.ts"() {
|
|
540
|
+
"use strict";
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
// libs/core/interfaces/playground-data.ts
|
|
545
|
+
var init_playground_data = __esm({
|
|
546
|
+
"libs/core/interfaces/playground-data.ts"() {
|
|
547
|
+
"use strict";
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
551
|
+
// libs/core/interfaces/playground-options.ts
|
|
552
|
+
var init_playground_options = __esm({
|
|
553
|
+
"libs/core/interfaces/playground-options.ts"() {
|
|
554
|
+
"use strict";
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
// libs/core/interfaces/section-index.ts
|
|
559
|
+
var init_section_index = __esm({
|
|
560
|
+
"libs/core/interfaces/section-index.ts"() {
|
|
561
|
+
"use strict";
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
// libs/core/interfaces/index.ts
|
|
566
|
+
var init_interfaces = __esm({
|
|
567
|
+
"libs/core/interfaces/index.ts"() {
|
|
568
|
+
"use strict";
|
|
569
|
+
init_api();
|
|
570
|
+
init_api_list();
|
|
571
|
+
init_api_list_item();
|
|
572
|
+
init_api_scope();
|
|
573
|
+
init_base_entity();
|
|
574
|
+
init_category();
|
|
575
|
+
init_content_module();
|
|
576
|
+
init_demo_options();
|
|
577
|
+
init_js_doc_metadata();
|
|
578
|
+
init_keyword_map();
|
|
579
|
+
init_page();
|
|
580
|
+
init_page_anchor();
|
|
581
|
+
init_page_info();
|
|
582
|
+
init_playground_config();
|
|
583
|
+
init_playground_content();
|
|
584
|
+
init_playground_data();
|
|
585
|
+
init_playground_options();
|
|
586
|
+
init_section_index();
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
// libs/core/types/code-type.ts
|
|
591
|
+
var init_code_type = __esm({
|
|
592
|
+
"libs/core/types/code-type.ts"() {
|
|
593
|
+
"use strict";
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
// libs/core/types/constructor.ts
|
|
598
|
+
var init_constructor = __esm({
|
|
599
|
+
"libs/core/types/constructor.ts"() {
|
|
600
|
+
"use strict";
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
// libs/core/types/entity-type.ts
|
|
605
|
+
var init_entity_type = __esm({
|
|
606
|
+
"libs/core/types/entity-type.ts"() {
|
|
607
|
+
"use strict";
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// libs/core/types/extracted-value.ts
|
|
612
|
+
var init_extracted_value = __esm({
|
|
613
|
+
"libs/core/types/extracted-value.ts"() {
|
|
614
|
+
"use strict";
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
|
|
618
|
+
// libs/core/types/function.ts
|
|
619
|
+
var init_function = __esm({
|
|
620
|
+
"libs/core/types/function.ts"() {
|
|
621
|
+
"use strict";
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// libs/core/types/heading.ts
|
|
626
|
+
var init_heading = __esm({
|
|
627
|
+
"libs/core/types/heading.ts"() {
|
|
628
|
+
"use strict";
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
// libs/core/types/input-type.ts
|
|
633
|
+
var init_input_type = __esm({
|
|
634
|
+
"libs/core/types/input-type.ts"() {
|
|
635
|
+
"use strict";
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// libs/core/types/keywords-loader.ts
|
|
640
|
+
var init_keywords_loader = __esm({
|
|
641
|
+
"libs/core/types/keywords-loader.ts"() {
|
|
642
|
+
"use strict";
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
// libs/core/types/page-type.ts
|
|
647
|
+
var init_page_type = __esm({
|
|
648
|
+
"libs/core/types/page-type.ts"() {
|
|
649
|
+
"use strict";
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
// libs/core/types/style-type.ts
|
|
654
|
+
var init_style_type = __esm({
|
|
655
|
+
"libs/core/types/style-type.ts"() {
|
|
656
|
+
"use strict";
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
// libs/core/types/index.ts
|
|
661
|
+
var init_types = __esm({
|
|
662
|
+
"libs/core/types/index.ts"() {
|
|
663
|
+
"use strict";
|
|
664
|
+
init_code_type();
|
|
665
|
+
init_constructor();
|
|
666
|
+
init_entity_type();
|
|
667
|
+
init_extracted_value();
|
|
668
|
+
init_function();
|
|
669
|
+
init_heading();
|
|
670
|
+
init_input_type();
|
|
671
|
+
init_keywords_loader();
|
|
672
|
+
init_page_type();
|
|
673
|
+
init_style_type();
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
// libs/core/index.ts
|
|
678
|
+
var init_core = __esm({
|
|
679
|
+
"libs/core/index.ts"() {
|
|
680
|
+
"use strict";
|
|
681
|
+
init_constants();
|
|
682
|
+
init_helpers();
|
|
683
|
+
init_interfaces();
|
|
684
|
+
init_types();
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
// libs/utils/html/helpers/attr-value.ts
|
|
689
|
+
function attrValue(node, attr) {
|
|
690
|
+
const attrKey = attr.toLowerCase();
|
|
691
|
+
return node.properties?.[attrKey] ? String(node.properties[attrKey]) : void 0;
|
|
692
|
+
}
|
|
693
|
+
var init_attr_value = __esm({
|
|
694
|
+
"libs/utils/html/helpers/attr-value.ts"() {
|
|
695
|
+
"use strict";
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
// libs/utils/html/helpers/has-class.ts
|
|
700
|
+
function hasClass(node, cls) {
|
|
701
|
+
const className = node.properties?.["className"]?.toString() ?? "";
|
|
702
|
+
return !!className && className.includes(cls);
|
|
703
|
+
}
|
|
704
|
+
var init_has_class = __esm({
|
|
705
|
+
"libs/utils/html/helpers/has-class.ts"() {
|
|
706
|
+
"use strict";
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
// libs/utils/html/helpers/has-link-ancestor.ts
|
|
711
|
+
import { isElement } from "hast-util-is-element";
|
|
712
|
+
function hasLinkAncestor(ancestors) {
|
|
713
|
+
return ancestors.some((ancestor) => isElement(ancestor, "a"));
|
|
714
|
+
}
|
|
715
|
+
var init_has_link_ancestor = __esm({
|
|
716
|
+
"libs/utils/html/helpers/has-link-ancestor.ts"() {
|
|
717
|
+
"use strict";
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
// libs/utils/html/helpers/is-code-block.ts
|
|
722
|
+
function isCodeBlock(parent, node) {
|
|
723
|
+
return parent?.type === "element" && parent.tagName === "pre" && node.tagName === "code";
|
|
724
|
+
}
|
|
725
|
+
var init_is_code_block = __esm({
|
|
726
|
+
"libs/utils/html/helpers/is-code-block.ts"() {
|
|
727
|
+
"use strict";
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
// libs/utils/html/helpers/is-code-node.ts
|
|
732
|
+
import { isElement as isElement2 } from "hast-util-is-element";
|
|
733
|
+
function isCodeNode(node) {
|
|
734
|
+
return isElement2(node, "code") || isElement2(node, "ng-doc-code");
|
|
735
|
+
}
|
|
736
|
+
var init_is_code_node = __esm({
|
|
737
|
+
"libs/utils/html/helpers/is-code-node.ts"() {
|
|
738
|
+
"use strict";
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
// libs/utils/html/helpers/is-element.ts
|
|
743
|
+
function isElement3(node) {
|
|
744
|
+
return node?.type === "element";
|
|
745
|
+
}
|
|
746
|
+
var init_is_element = __esm({
|
|
747
|
+
"libs/utils/html/helpers/is-element.ts"() {
|
|
748
|
+
"use strict";
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
// libs/utils/html/helpers/is-heading.ts
|
|
753
|
+
import { isElement as isElement4 } from "hast-util-is-element";
|
|
754
|
+
function isHeading(node) {
|
|
755
|
+
return isElement4(node, HEADINGS);
|
|
756
|
+
}
|
|
757
|
+
var HEADINGS;
|
|
758
|
+
var init_is_heading = __esm({
|
|
759
|
+
"libs/utils/html/helpers/is-heading.ts"() {
|
|
760
|
+
"use strict";
|
|
761
|
+
HEADINGS = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
// libs/utils/html/helpers/index.ts
|
|
766
|
+
var init_helpers2 = __esm({
|
|
767
|
+
"libs/utils/html/helpers/index.ts"() {
|
|
768
|
+
"use strict";
|
|
769
|
+
init_attr_value();
|
|
770
|
+
init_has_class();
|
|
771
|
+
init_has_link_ancestor();
|
|
772
|
+
init_is_code_block();
|
|
773
|
+
init_is_code_node();
|
|
774
|
+
init_is_element();
|
|
775
|
+
init_is_heading();
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
|
|
779
|
+
// libs/utils/html/plugins/keywords.plugin.ts
|
|
780
|
+
import { isElement as isElement5 } from "hast-util-is-element";
|
|
781
|
+
import { toString } from "hast-util-to-string";
|
|
782
|
+
import { SKIP, visitParents } from "unist-util-visit-parents";
|
|
783
|
+
function keywordsPlugin(config) {
|
|
784
|
+
return (tree) => visitParents(tree, "element", (node, ancestors) => {
|
|
785
|
+
if (!isCodeNode(node)) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
const isInlineCode = !isElement5(ancestors[ancestors.length - 1], "pre");
|
|
789
|
+
const lang = asArray(node.properties?.["className"] ?? []).find((className) => className.startsWith("language-"))?.replace("language-", "") ?? "";
|
|
790
|
+
if (isInlineCode || LANGUAGES.includes(lang)) {
|
|
791
|
+
visitParents(node, "text", (node2, ancestors2) => {
|
|
792
|
+
if (hasLinkAncestor(ancestors2)) {
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
const parent = ancestors2[ancestors2.length - 1];
|
|
796
|
+
const index = parent.children.indexOf(node2);
|
|
797
|
+
const nodes = getNodes(node2, parent, isInlineCode, config, lang);
|
|
798
|
+
Array.prototype.splice.apply(parent.children, [index, 1].concat(nodes));
|
|
799
|
+
return [SKIP, index + nodes.length];
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
function getNodes(node, parent, isInlineCode, config, language) {
|
|
805
|
+
const { addUsedKeyword, getKeyword } = config;
|
|
806
|
+
return toString(node).split(SPLIT_REGEXP).map((word) => {
|
|
807
|
+
const match = word.match(MATCH_KEYWORD_REGEXP);
|
|
808
|
+
if (!match) {
|
|
809
|
+
return { type: "text", value: word };
|
|
810
|
+
}
|
|
811
|
+
const {
|
|
812
|
+
key = "",
|
|
813
|
+
delimiter = "",
|
|
814
|
+
anchor = "",
|
|
815
|
+
queryParams = ""
|
|
816
|
+
} = match.groups;
|
|
817
|
+
const usedKeyword = `${key}${delimiter}${anchor?.toLowerCase()}`;
|
|
818
|
+
const rootKeyword = getKeyword?.(key);
|
|
819
|
+
const keyword = getKeyword?.(usedKeyword);
|
|
820
|
+
const isGuideKeyword = key.startsWith("*");
|
|
821
|
+
const isLanguageAllowed = !keyword?.languages && ALWAYS_ALLOWED_LANGUAGES.includes(language) || !!keyword?.languages?.includes(language);
|
|
822
|
+
if (!isInlineCode && keyword && !isLanguageAllowed) {
|
|
823
|
+
return { type: "text", value: word };
|
|
824
|
+
}
|
|
825
|
+
if (isGuideKeyword && key.length === 1) {
|
|
826
|
+
return { type: "text", value: word };
|
|
827
|
+
}
|
|
828
|
+
addUsedKeyword?.(usedKeyword);
|
|
829
|
+
const notFoundGuideKeyword = isGuideKeyword && !keyword;
|
|
830
|
+
const notFoundApiAnchorKeyword = !!rootKeyword && !!anchor && !keyword;
|
|
831
|
+
if (getKeyword && isInlineCode && (notFoundGuideKeyword || notFoundApiAnchorKeyword)) {
|
|
832
|
+
throw new Error(`Route with keyword "${word}" is missing.`);
|
|
833
|
+
}
|
|
834
|
+
if (parent.properties) {
|
|
835
|
+
if (isInlineCode && keyword?.type === "link") {
|
|
836
|
+
parent.tagName = "a";
|
|
837
|
+
parent.properties = {
|
|
838
|
+
href: `${keyword.path}${queryParams ?? ""}`,
|
|
839
|
+
className: [NG_DOC_ELEMENT]
|
|
840
|
+
};
|
|
841
|
+
return { type: "text", value: keyword.title };
|
|
842
|
+
} else if (isInlineCode && keyword) {
|
|
843
|
+
parent.properties["className"] = [NG_DOC_ELEMENT, "ng-doc-code-with-link"];
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return keyword ? createLinkNode(
|
|
847
|
+
isInlineCode ? keyword.title : word,
|
|
848
|
+
keyword.path,
|
|
849
|
+
keyword.type,
|
|
850
|
+
keyword.description
|
|
851
|
+
) : { type: "text", value: word };
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
function createLinkNode(text, href, type, description) {
|
|
855
|
+
return {
|
|
856
|
+
type: "element",
|
|
857
|
+
tagName: "a",
|
|
858
|
+
properties: {
|
|
859
|
+
href,
|
|
860
|
+
class: ["ng-doc-code-anchor", NG_DOC_ELEMENT],
|
|
861
|
+
"data-link-type": type,
|
|
862
|
+
ngDocTooltip: description
|
|
863
|
+
},
|
|
864
|
+
children: [{ type: "text", value: text }]
|
|
865
|
+
};
|
|
866
|
+
}
|
|
867
|
+
var ALWAYS_ALLOWED_LANGUAGES, LANGUAGES, SPLIT_REGEXP, MATCH_KEYWORD_REGEXP;
|
|
868
|
+
var init_keywords_plugin = __esm({
|
|
869
|
+
"libs/utils/html/plugins/keywords.plugin.ts"() {
|
|
870
|
+
"use strict";
|
|
871
|
+
init_core();
|
|
872
|
+
init_helpers2();
|
|
873
|
+
ALWAYS_ALLOWED_LANGUAGES = ["typescript", "ts", "angular-ts"];
|
|
874
|
+
LANGUAGES = ["typescript", "ts", "angular-ts", ...KEYWORD_ALLOWED_LANGUAGES];
|
|
875
|
+
SPLIT_REGEXP = /([*\p{L}\w$@-]+(?:[.#][\p{L}\w-]+)?(?:\?[\w=&]+)?)/u;
|
|
876
|
+
MATCH_KEYWORD_REGEXP = /(?<key>[*\p{L}\w$@-]+)((?<delimiter>[.#])(?<anchor>[\p{L}\w-]+))?(?<queryParams>\?[\w=&]+)?/u;
|
|
877
|
+
}
|
|
878
|
+
});
|
|
879
|
+
|
|
880
|
+
// libs/utils/html/post-process-html.ts
|
|
881
|
+
import rehypeParse2 from "rehype-parse";
|
|
882
|
+
import rehypeStringify2 from "rehype-stringify";
|
|
883
|
+
import { unified as unified2 } from "unified";
|
|
884
|
+
async function postProcessHtml(html) {
|
|
885
|
+
const usedKeywords = /* @__PURE__ */ new Set();
|
|
886
|
+
try {
|
|
887
|
+
const content = await unified2().use(rehypeParse2, { fragment: true }).use(rehypeStringify2).use(keywordsPlugin, { addUsedKeyword: usedKeywords.add.bind(usedKeywords) }).process(html).then((file) => file.toString());
|
|
888
|
+
return { content, usedKeywords: Array.from(usedKeywords) };
|
|
889
|
+
} catch (error) {
|
|
890
|
+
return { content: html, usedKeywords: [], error };
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
var init_post_process_html = __esm({
|
|
894
|
+
"libs/utils/html/post-process-html.ts"() {
|
|
895
|
+
"use strict";
|
|
896
|
+
init_keywords_plugin();
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
// libs/utils/html/plugins/add-heading-anchors.plugin.ts
|
|
901
|
+
import { visit } from "unist-util-visit";
|
|
902
|
+
function addHeadingAnchors(route) {
|
|
903
|
+
return (tree) => visit(tree, "element", (node) => {
|
|
904
|
+
if (route && isHeading(node) && node.properties && node.properties["id"] && !hasClass(node, NO_ANCHOR_CLASS)) {
|
|
905
|
+
node.children.push({
|
|
906
|
+
type: "element",
|
|
907
|
+
tagName: "ng-doc-heading-anchor",
|
|
908
|
+
properties: {
|
|
909
|
+
className: ["ng-doc-anchor"],
|
|
910
|
+
anchor: node.properties["id"]
|
|
911
|
+
},
|
|
912
|
+
children: []
|
|
913
|
+
});
|
|
914
|
+
node.properties = {
|
|
915
|
+
...node.properties,
|
|
916
|
+
href: route,
|
|
917
|
+
headingLink: "true"
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
var NO_ANCHOR_CLASS;
|
|
923
|
+
var init_add_heading_anchors_plugin = __esm({
|
|
924
|
+
"libs/utils/html/plugins/add-heading-anchors.plugin.ts"() {
|
|
925
|
+
"use strict";
|
|
926
|
+
init_helpers2();
|
|
927
|
+
NO_ANCHOR_CLASS = "no-anchor";
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
// libs/utils/html/plugins/cached-shiki.plugin.ts
|
|
932
|
+
import rehypeShiki from "@shikijs/rehype";
|
|
933
|
+
import { toString as toString2 } from "hast-util-to-string";
|
|
934
|
+
import { visit as visit2 } from "unist-util-visit";
|
|
935
|
+
function cachedShikiPlugin(settings) {
|
|
936
|
+
const { cache, themes, identity, defaultLanguage } = settings;
|
|
937
|
+
const id = `${themes.light}
|
|
938
|
+
${themes.dark}`;
|
|
939
|
+
return async (tree) => {
|
|
940
|
+
const blocks = [];
|
|
941
|
+
visit2(tree, "element", (node, index, parent) => {
|
|
942
|
+
if (!parent || index == null || node.tagName !== "pre") return;
|
|
943
|
+
const head = node.children[0];
|
|
944
|
+
if (!head || head.type !== "element" || head.tagName !== "code" || !head.properties) return;
|
|
945
|
+
const classes = head.properties["className"];
|
|
946
|
+
const languageClass = Array.isArray(classes) ? classes.find((item) => typeof item === "string" && item.startsWith(languagePrefix)) : void 0;
|
|
947
|
+
const lang = typeof languageClass === "string" ? languageClass.slice(languagePrefix.length) : defaultLanguage;
|
|
948
|
+
if (!lang) return;
|
|
949
|
+
const data = head.data;
|
|
950
|
+
const meta = data?.meta ?? head.properties["metastring"]?.toString() ?? "";
|
|
951
|
+
const code = toString2(head);
|
|
952
|
+
blocks.push({
|
|
953
|
+
node,
|
|
954
|
+
parent,
|
|
955
|
+
key: cache.key({ options: identity, themes, lang, meta, code })
|
|
956
|
+
});
|
|
957
|
+
});
|
|
958
|
+
let highlighter;
|
|
959
|
+
const load = async () => highlighter ??= await highlighterFor(id, settings.options);
|
|
960
|
+
if (cache.loads?.(themes) !== true) await load();
|
|
961
|
+
const values = [];
|
|
962
|
+
for (const block of blocks) {
|
|
963
|
+
const cached = cache.get(block.key);
|
|
964
|
+
const hit = cached === void 0 ? void 0 : fragment(cached);
|
|
965
|
+
if (hit && !cache.verify) {
|
|
966
|
+
values.push(hit);
|
|
967
|
+
continue;
|
|
968
|
+
}
|
|
969
|
+
const fresh = await highlight(await load(), block.node);
|
|
970
|
+
if (hit && fresh !== cached) cache.mismatch?.(block.key);
|
|
971
|
+
if (fresh !== cached) cache.set(block.key, fresh);
|
|
972
|
+
values.push(JSON.parse(fresh));
|
|
973
|
+
}
|
|
974
|
+
blocks.forEach((block, position) => {
|
|
975
|
+
const index = block.parent.children.indexOf(block.node);
|
|
976
|
+
if (index >= 0) block.parent.children.splice(index, 1, ...values[position]);
|
|
977
|
+
});
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function highlighterFor(id, options) {
|
|
981
|
+
const known = highlighters.get(id);
|
|
982
|
+
if (known) return known;
|
|
983
|
+
const created = (async () => {
|
|
984
|
+
const transform = rehypeShiki(
|
|
985
|
+
options()
|
|
986
|
+
);
|
|
987
|
+
await transform({ type: "root", children: [] });
|
|
988
|
+
return transform;
|
|
989
|
+
})();
|
|
990
|
+
highlighters.set(id, created);
|
|
991
|
+
created.catch(() => {
|
|
992
|
+
if (highlighters.get(id) === created) highlighters.delete(id);
|
|
993
|
+
});
|
|
994
|
+
return created;
|
|
995
|
+
}
|
|
996
|
+
async function highlight(transform, node) {
|
|
997
|
+
const root = { type: "root", children: [node] };
|
|
998
|
+
await transform(root);
|
|
999
|
+
return JSON.stringify(root.children);
|
|
1000
|
+
}
|
|
1001
|
+
function fragment(value) {
|
|
1002
|
+
try {
|
|
1003
|
+
const parsed = JSON.parse(value);
|
|
1004
|
+
return Array.isArray(parsed) && parsed.length > 0 && parsed.every((item) => isNode(item) && item.type === "element") ? parsed : void 0;
|
|
1005
|
+
} catch {
|
|
1006
|
+
return void 0;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
function isNode(value) {
|
|
1010
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
1011
|
+
const node = value;
|
|
1012
|
+
if (node["type"] === "text") return typeof node["value"] === "string";
|
|
1013
|
+
const properties = node["properties"];
|
|
1014
|
+
const children = node["children"];
|
|
1015
|
+
return node["type"] === "element" && typeof node["tagName"] === "string" && !!properties && typeof properties === "object" && !Array.isArray(properties) && Array.isArray(children) && children.every(isNode);
|
|
1016
|
+
}
|
|
1017
|
+
var languagePrefix, highlighters;
|
|
1018
|
+
var init_cached_shiki_plugin = __esm({
|
|
1019
|
+
"libs/utils/html/plugins/cached-shiki.plugin.ts"() {
|
|
1020
|
+
"use strict";
|
|
1021
|
+
languagePrefix = "language-";
|
|
1022
|
+
highlighters = /* @__PURE__ */ new Map();
|
|
1023
|
+
}
|
|
1024
|
+
});
|
|
1025
|
+
|
|
1026
|
+
// libs/utils/html/plugins/highlight-code-lines.ts
|
|
1027
|
+
import { visit as visit3 } from "unist-util-visit";
|
|
1028
|
+
function highlightCodeLines() {
|
|
1029
|
+
return (tree) => {
|
|
1030
|
+
visit3(tree, "element", (node, _i, parent) => {
|
|
1031
|
+
if (isCodeBlock(parent, node) && parent?.type === "element") {
|
|
1032
|
+
const highlightedLines = JSON.parse(
|
|
1033
|
+
attrValue(parent, "highlightedLines") ?? "[]"
|
|
1034
|
+
);
|
|
1035
|
+
highlightedLines.length && node.children.filter(isElement3).forEach((child, i) => {
|
|
1036
|
+
if (child.properties.class === "line" && highlightedLines.includes(i + 1)) {
|
|
1037
|
+
child.properties.class = "line highlighted";
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
var init_highlight_code_lines = __esm({
|
|
1045
|
+
"libs/utils/html/plugins/highlight-code-lines.ts"() {
|
|
1046
|
+
"use strict";
|
|
1047
|
+
init_helpers2();
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
// libs/utils/html/plugins/mark-elements.plugin.ts
|
|
1052
|
+
import { visit as visit4 } from "unist-util-visit";
|
|
1053
|
+
function markElementsPlugin() {
|
|
1054
|
+
return (tree) => {
|
|
1055
|
+
visit4(tree, "element", (node) => {
|
|
1056
|
+
if (node.properties) {
|
|
1057
|
+
node.properties["className"] = [...asArray(node.properties.className), NG_DOC_ELEMENT];
|
|
1058
|
+
}
|
|
1059
|
+
});
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
var init_mark_elements_plugin = __esm({
|
|
1063
|
+
"libs/utils/html/plugins/mark-elements.plugin.ts"() {
|
|
1064
|
+
"use strict";
|
|
1065
|
+
init_core();
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
|
|
1069
|
+
// libs/utils/html/plugins/mermaid.plugin.ts
|
|
1070
|
+
import { toString as toString3 } from "hast-util-to-string";
|
|
1071
|
+
import { visit as visit5 } from "unist-util-visit";
|
|
1072
|
+
function mermaidPlugin() {
|
|
1073
|
+
return (tree) => {
|
|
1074
|
+
visit5(tree, "element", (node) => {
|
|
1075
|
+
if (node.tagName === "pre") {
|
|
1076
|
+
const codeNode = node.children[0];
|
|
1077
|
+
if (codeNode.tagName === "code" && codeNode.properties?.["lang"] === "mermaid") {
|
|
1078
|
+
node.properties = { className: ["mermaid"] };
|
|
1079
|
+
node.children = [
|
|
1080
|
+
{
|
|
1081
|
+
type: "text",
|
|
1082
|
+
value: toString3(codeNode)
|
|
1083
|
+
}
|
|
1084
|
+
];
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
var init_mermaid_plugin = __esm({
|
|
1091
|
+
"libs/utils/html/plugins/mermaid.plugin.ts"() {
|
|
1092
|
+
"use strict";
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
|
|
1096
|
+
// libs/utils/html/plugins/slugger.plugin.ts
|
|
1097
|
+
import GithubSlugger from "github-slugger";
|
|
1098
|
+
import { hasProperty } from "hast-util-has-property";
|
|
1099
|
+
import { headingRank } from "hast-util-heading-rank";
|
|
1100
|
+
import { isElement as isElement6 } from "hast-util-is-element";
|
|
1101
|
+
import { toString as toString4 } from "hast-util-to-string";
|
|
1102
|
+
import { visitParents as visitParents2 } from "unist-util-visit-parents";
|
|
1103
|
+
function sluggerPlugin(addAnchor, headings = ["h1", "h2", "h3", "h4"]) {
|
|
1104
|
+
if (!addAnchor) {
|
|
1105
|
+
return () => {
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
const slugger = new GithubSlugger();
|
|
1109
|
+
return (tree) => {
|
|
1110
|
+
slugger.reset();
|
|
1111
|
+
visitParents2(tree, "element", (node, ancestors) => {
|
|
1112
|
+
const scope = getKeywordScope(ancestors);
|
|
1113
|
+
const isHeading2 = !!headingRank(node) && !hasProperty(node, "id") && !!headings?.includes(node.tagName.toLowerCase());
|
|
1114
|
+
const attrSlug = attrValue(node, "dataSlug");
|
|
1115
|
+
const attrSlugTitle = attrValue(node, "dataSlugTitle");
|
|
1116
|
+
const attrSlugType = attrValue(node, "dataSlugType");
|
|
1117
|
+
const dataToSlug = isHeading2 ? toString4(node).trim() : attrSlug;
|
|
1118
|
+
if (dataToSlug) {
|
|
1119
|
+
if (node.properties) {
|
|
1120
|
+
const id = attrSlug && attrSlugType === "member" ? attrSlug : slugger.slug(dataToSlug);
|
|
1121
|
+
node.properties["id"] = id;
|
|
1122
|
+
if (isHeading2) {
|
|
1123
|
+
hideLeadingEmoji(node);
|
|
1124
|
+
}
|
|
1125
|
+
addAnchor({
|
|
1126
|
+
anchorId: id,
|
|
1127
|
+
anchor: new GithubSlugger().slug(dataToSlug),
|
|
1128
|
+
title: attrSlugTitle || dataToSlug,
|
|
1129
|
+
scope,
|
|
1130
|
+
type: isHeading2 && attrSlugType !== "member" || attrSlug && attrSlugType === "heading" ? "heading" : "member"
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
function hideLeadingEmoji(heading) {
|
|
1138
|
+
const first = heading.children[0];
|
|
1139
|
+
const emoji = first?.type === "text" ? LEADING_EMOJI.exec(first.value)?.[0] : void 0;
|
|
1140
|
+
if (!emoji) {
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
const rest = { type: "text", value: first.value.slice(emoji.length) };
|
|
1144
|
+
heading.children.splice(
|
|
1145
|
+
0,
|
|
1146
|
+
1,
|
|
1147
|
+
{
|
|
1148
|
+
type: "element",
|
|
1149
|
+
tagName: "span",
|
|
1150
|
+
properties: { ariaHidden: "true" },
|
|
1151
|
+
children: [{ type: "text", value: emoji }]
|
|
1152
|
+
},
|
|
1153
|
+
rest
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
function getKeywordScope(ancestors) {
|
|
1157
|
+
const keywordScope = ancestors.find(
|
|
1158
|
+
(ancestor) => isElement6(ancestor) && ancestor.tagName === "ng-doc-keyword-scope"
|
|
1159
|
+
);
|
|
1160
|
+
const key = keywordScope?.properties?.["id"];
|
|
1161
|
+
return key ? {
|
|
1162
|
+
key: String(key),
|
|
1163
|
+
title: String(keywordScope?.properties?.["title"])
|
|
1164
|
+
} : void 0;
|
|
1165
|
+
}
|
|
1166
|
+
var LEADING_EMOJI;
|
|
1167
|
+
var init_slugger_plugin = __esm({
|
|
1168
|
+
"libs/utils/html/plugins/slugger.plugin.ts"() {
|
|
1169
|
+
"use strict";
|
|
1170
|
+
init_helpers2();
|
|
1171
|
+
LEADING_EMOJI = new RegExp("^(?:\\p{Regional_Indicator}{2}|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)(?:\\p{Emoji_Modifier}|\\uFE0F|\\u200D\\p{Extended_Pictographic}\\uFE0F?)*)(?=\\s)", "u");
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
|
|
1175
|
+
// libs/utils/html/plugins/table-wrapper.ts
|
|
1176
|
+
import { visit as visit6 } from "unist-util-visit";
|
|
1177
|
+
function table_wrapper_default() {
|
|
1178
|
+
return (tree) => {
|
|
1179
|
+
visit6(tree, "element", (node, index, parent) => {
|
|
1180
|
+
const table = node?.tagName === "table";
|
|
1181
|
+
if (table) {
|
|
1182
|
+
const wrapper = {
|
|
1183
|
+
type: "element",
|
|
1184
|
+
tagName: "div",
|
|
1185
|
+
properties: {
|
|
1186
|
+
className: "ng-doc-table-wrapper"
|
|
1187
|
+
},
|
|
1188
|
+
children: [node]
|
|
1189
|
+
};
|
|
1190
|
+
parent.children[index] = wrapper;
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
var init_table_wrapper = __esm({
|
|
1196
|
+
"libs/utils/html/plugins/table-wrapper.ts"() {
|
|
1197
|
+
"use strict";
|
|
1198
|
+
}
|
|
1199
|
+
});
|
|
1200
|
+
|
|
1201
|
+
// libs/utils/html/process-html.ts
|
|
1202
|
+
import rehypeShiki2 from "@shikijs/rehype";
|
|
1203
|
+
import rehypeMinifyWhitespace2 from "rehype-minify-whitespace";
|
|
1204
|
+
import rehypeParse3 from "rehype-parse";
|
|
1205
|
+
import rehypeStringify3 from "rehype-stringify";
|
|
1206
|
+
import { unified as unified3 } from "unified";
|
|
1207
|
+
async function processHtml(html, config) {
|
|
1208
|
+
const anchors = /* @__PURE__ */ new Set();
|
|
1209
|
+
const themes = {
|
|
1210
|
+
light: config.lightTheme ?? "github-light",
|
|
1211
|
+
dark: config.darkTheme ?? "ayu-dark"
|
|
1212
|
+
};
|
|
1213
|
+
try {
|
|
1214
|
+
const content = await unified3().use(rehypeParse3, { fragment: true }).use(rehypeStringify3).use(mermaidPlugin).use(
|
|
1215
|
+
config.highlight ? [
|
|
1216
|
+
[
|
|
1217
|
+
cachedShikiPlugin,
|
|
1218
|
+
{
|
|
1219
|
+
cache: config.highlight,
|
|
1220
|
+
themes,
|
|
1221
|
+
identity: HIGHLIGHT_IDENTITY,
|
|
1222
|
+
defaultLanguage: DEFAULT_LANGUAGE,
|
|
1223
|
+
options: () => shikiOptions(themes)
|
|
1224
|
+
}
|
|
1225
|
+
]
|
|
1226
|
+
] : [[rehypeShiki2, shikiOptions(themes)]]
|
|
1227
|
+
).use(highlightCodeLines).use(table_wrapper_default).use(sluggerPlugin, anchors.add.bind(anchors), config.headings).use(rehypeMinifyWhitespace2).use(addHeadingAnchors, config.route).use(markElementsPlugin).process(html).then((file) => file.toString());
|
|
1228
|
+
return { content, anchors: Array.from(anchors) };
|
|
1229
|
+
} catch (error) {
|
|
1230
|
+
return { content: html, anchors: [], error };
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
function shikiOptions(themes) {
|
|
1234
|
+
return {
|
|
1235
|
+
defaultLanguage: DEFAULT_LANGUAGE,
|
|
1236
|
+
fallbackLanguage: "text",
|
|
1237
|
+
addLanguageClass: true,
|
|
1238
|
+
parseMetaString: (meta) => JSON.parse(meta?.replace(/\\/g, "") || "{}"),
|
|
1239
|
+
// Shiki stops tokenizing a line after 500 ms by default and silently colours the rest of
|
|
1240
|
+
// it like the last token. A slow or pre-empted process then renders other HTML than a fast
|
|
1241
|
+
// one, so the build output would depend on machine load. No limit keeps it deterministic.
|
|
1242
|
+
tokenizeTimeLimit: 0,
|
|
1243
|
+
themes: {
|
|
1244
|
+
light: shikiTheme(themes.light),
|
|
1245
|
+
dark: shikiTheme(themes.dark)
|
|
1246
|
+
}
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
function shikiTheme(name) {
|
|
1250
|
+
return name === NG_DOC_SYNTAX_THEME_NAME ? ngDocSyntaxTheme() : name;
|
|
1251
|
+
}
|
|
1252
|
+
var DEFAULT_LANGUAGE, HIGHLIGHT_IDENTITY;
|
|
1253
|
+
var init_process_html = __esm({
|
|
1254
|
+
"libs/utils/html/process-html.ts"() {
|
|
1255
|
+
"use strict";
|
|
1256
|
+
init_core();
|
|
1257
|
+
init_add_heading_anchors_plugin();
|
|
1258
|
+
init_cached_shiki_plugin();
|
|
1259
|
+
init_highlight_code_lines();
|
|
1260
|
+
init_mark_elements_plugin();
|
|
1261
|
+
init_mermaid_plugin();
|
|
1262
|
+
init_slugger_plugin();
|
|
1263
|
+
init_table_wrapper();
|
|
1264
|
+
DEFAULT_LANGUAGE = "ts";
|
|
1265
|
+
HIGHLIGHT_IDENTITY = {
|
|
1266
|
+
format: 1,
|
|
1267
|
+
defaultLanguage: DEFAULT_LANGUAGE,
|
|
1268
|
+
fallbackLanguage: "text",
|
|
1269
|
+
addLanguageClass: true,
|
|
1270
|
+
parseMetaString: "json-without-backslashes",
|
|
1271
|
+
tokenizeTimeLimit: 0
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
|
|
1276
|
+
// libs/utils/html/plugins/remove-not-indexable-content.plugin.ts
|
|
1277
|
+
import { filter } from "unist-util-filter";
|
|
1278
|
+
import { visit as visit7 } from "unist-util-visit";
|
|
1279
|
+
function removeNotIndexableContentPlugin() {
|
|
1280
|
+
return (tree) => {
|
|
1281
|
+
visit7(tree, "element", (node) => {
|
|
1282
|
+
if (isHeading(node) && isHiddenSpan(node.children[0])) {
|
|
1283
|
+
node.children = node.children.slice(1);
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
return filter(tree, { cascade: true }, (node) => {
|
|
1287
|
+
const preWithCode = node?.tagName === "pre" && node?.children?.some(isCodeNode);
|
|
1288
|
+
const notIndexable = node?.properties?.["indexable"] === "false";
|
|
1289
|
+
return !node?.tagName || !preWithCode && !notIndexable;
|
|
1290
|
+
});
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
function isHiddenSpan(node) {
|
|
1294
|
+
return node?.type === "element" && node.tagName === "span" && node.properties?.["ariaHidden"] === "true";
|
|
1295
|
+
}
|
|
1296
|
+
var init_remove_not_indexable_content_plugin = __esm({
|
|
1297
|
+
"libs/utils/html/plugins/remove-not-indexable-content.plugin.ts"() {
|
|
1298
|
+
"use strict";
|
|
1299
|
+
init_helpers2();
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
// libs/utils/html/remove-not-indexable-content.ts
|
|
1304
|
+
import { rehype } from "rehype";
|
|
1305
|
+
async function removeNotIndexableContent(html) {
|
|
1306
|
+
return rehype().use(removeNotIndexableContentPlugin).process(html).then((file) => file.toString());
|
|
1307
|
+
}
|
|
1308
|
+
var init_remove_not_indexable_content = __esm({
|
|
1309
|
+
"libs/utils/html/remove-not-indexable-content.ts"() {
|
|
1310
|
+
"use strict";
|
|
1311
|
+
init_remove_not_indexable_content_plugin();
|
|
1312
|
+
}
|
|
1313
|
+
});
|
|
1314
|
+
|
|
1315
|
+
// libs/utils/html/replace-keywords.ts
|
|
1316
|
+
import rehypeParse4 from "rehype-parse";
|
|
1317
|
+
import rehypeStringify4 from "rehype-stringify";
|
|
1318
|
+
import { unified as unified4 } from "unified";
|
|
1319
|
+
async function replaceKeywords(html, { getKeyword }) {
|
|
1320
|
+
return unified4().use(rehypeParse4, { fragment: true }).use(rehypeStringify4).use(keywordsPlugin, { getKeyword }).process(html).then((file) => file.toString());
|
|
1321
|
+
}
|
|
1322
|
+
var init_replace_keywords = __esm({
|
|
1323
|
+
"libs/utils/html/replace-keywords.ts"() {
|
|
1324
|
+
"use strict";
|
|
1325
|
+
init_keywords_plugin();
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1328
|
+
|
|
1329
|
+
// libs/utils/html/stringify-entities.ts
|
|
1330
|
+
import { stringifyEntities as stringify } from "stringify-entities";
|
|
1331
|
+
function stringifyEntities(content) {
|
|
1332
|
+
return stringify(content);
|
|
1333
|
+
}
|
|
1334
|
+
var init_stringify_entities = __esm({
|
|
1335
|
+
"libs/utils/html/stringify-entities.ts"() {
|
|
1336
|
+
"use strict";
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
// libs/utils/index.ts
|
|
1341
|
+
var utils_exports = {};
|
|
1342
|
+
__export(utils_exports, {
|
|
1343
|
+
minify: () => minify,
|
|
1344
|
+
postProcessHtml: () => postProcessHtml,
|
|
1345
|
+
processHtml: () => processHtml,
|
|
1346
|
+
removeNotIndexableContent: () => removeNotIndexableContent,
|
|
1347
|
+
replaceKeywords: () => replaceKeywords,
|
|
1348
|
+
stringifyEntities: () => stringifyEntities
|
|
1349
|
+
});
|
|
1350
|
+
var init_utils = __esm({
|
|
1351
|
+
"libs/utils/index.ts"() {
|
|
1352
|
+
"use strict";
|
|
1353
|
+
init_minify();
|
|
1354
|
+
init_post_process_html();
|
|
1355
|
+
init_process_html();
|
|
1356
|
+
init_remove_not_indexable_content();
|
|
1357
|
+
init_replace_keywords();
|
|
1358
|
+
init_stringify_entities();
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
|
|
1362
|
+
// libs/builder/generator/content/html-pipeline.ts
|
|
1363
|
+
import { parseFile } from "@orama/plugin-parsedoc";
|
|
1364
|
+
async function renderDocuments(task, highlight2, aborted = notAborted) {
|
|
1365
|
+
const results = [];
|
|
1366
|
+
for (const document of task.documents) {
|
|
1367
|
+
const result = await renderDocument(document, task.themes, highlight2, aborted);
|
|
1368
|
+
results.push(result);
|
|
1369
|
+
if (!("html" in result)) break;
|
|
1370
|
+
}
|
|
1371
|
+
return results;
|
|
1372
|
+
}
|
|
1373
|
+
async function renderDocument(document, themes, highlight2, aborted) {
|
|
1374
|
+
if (aborted()) return { aborted: true, mismatches: 0 };
|
|
1375
|
+
const utilities = await htmlUtilities();
|
|
1376
|
+
if (aborted()) return { aborted: true, mismatches: 0 };
|
|
1377
|
+
const call = highlight2();
|
|
1378
|
+
const result = await utilities.processHtml(document.html, {
|
|
1379
|
+
..."headings" in document ? { headings: document.headings } : {},
|
|
1380
|
+
...document.route === void 0 ? {} : { route: document.route },
|
|
1381
|
+
lightTheme: themes.light,
|
|
1382
|
+
darkTheme: themes.dark,
|
|
1383
|
+
...call ? { highlight: call } : {}
|
|
1384
|
+
});
|
|
1385
|
+
const mismatches = call?.mismatches.length ?? 0;
|
|
1386
|
+
if (result.error) return { failed: "process", message: String(result.error), mismatches };
|
|
1387
|
+
if (aborted()) return { aborted: true, mismatches };
|
|
1388
|
+
const post = await utilities.postProcessHtml(result.content);
|
|
1389
|
+
if (post.error) return { failed: "post-process", message: String(post.error), mismatches };
|
|
1390
|
+
if (aborted()) return { aborted: true, mismatches };
|
|
1391
|
+
return {
|
|
1392
|
+
html: post.content,
|
|
1393
|
+
anchors: result.anchors.map(normalizeAnchor),
|
|
1394
|
+
usedKeywords: post.usedKeywords,
|
|
1395
|
+
mismatches
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
async function linkDocument(task, getKeyword, aborted = notAborted) {
|
|
1399
|
+
const consulted = [];
|
|
1400
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1401
|
+
try {
|
|
1402
|
+
const utilities = await htmlUtilities();
|
|
1403
|
+
const html = await utilities.replaceKeywords(task.html, {
|
|
1404
|
+
getKeyword: (key) => {
|
|
1405
|
+
if (!seen.has(key)) {
|
|
1406
|
+
seen.add(key);
|
|
1407
|
+
consulted.push(key);
|
|
1408
|
+
}
|
|
1409
|
+
return getKeyword(key);
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
if (aborted()) return { aborted: true, consulted };
|
|
1413
|
+
const indexable = await utilities.removeNotIndexableContent(html);
|
|
1414
|
+
if (aborted()) return { aborted: true, consulted };
|
|
1415
|
+
const searchRecords = await buildSearchRecords(indexable, task);
|
|
1416
|
+
if (aborted()) return { aborted: true, consulted };
|
|
1417
|
+
return { html, searchRecords, consulted };
|
|
1418
|
+
} catch (error) {
|
|
1419
|
+
return { failed: String(error), consulted };
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
function bindingsOf(keywords) {
|
|
1423
|
+
return new Map(keywords.map((keyword) => [keyword.key, keyword]));
|
|
1424
|
+
}
|
|
1425
|
+
async function buildSearchRecords(html, task) {
|
|
1426
|
+
const documents = await parseFile(html, "html", {
|
|
1427
|
+
transformFn: transformSearchNode,
|
|
1428
|
+
mergeStrategy: "split"
|
|
1429
|
+
});
|
|
1430
|
+
const records = [];
|
|
1431
|
+
let section;
|
|
1432
|
+
for (const document of documents) {
|
|
1433
|
+
if (!document?.content?.trim()) continue;
|
|
1434
|
+
if (isSearchHeading(document)) {
|
|
1435
|
+
section = document;
|
|
1436
|
+
continue;
|
|
1437
|
+
}
|
|
1438
|
+
const fragment2 = section?.properties?.["id"];
|
|
1439
|
+
records.push({
|
|
1440
|
+
breadcrumbs: task.breadcrumbs,
|
|
1441
|
+
pageType: task.pageType,
|
|
1442
|
+
// Without the whitespace around them, a no-break space included: a heading's decorative
|
|
1443
|
+
// emoji is joined to its text with one. `helpers/build-indexes.ts` of the legacy engine trims
|
|
1444
|
+
// them the same way; keep both in step, so the two search indexes stay equal.
|
|
1445
|
+
title: task.title.trim(),
|
|
1446
|
+
section: (section?.content ?? "").trim(),
|
|
1447
|
+
route: task.absoluteRoute,
|
|
1448
|
+
...typeof fragment2 === "string" && fragment2 ? { fragment: fragment2 } : {},
|
|
1449
|
+
content: document.content
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
return records;
|
|
1453
|
+
}
|
|
1454
|
+
function transformSearchNode(node) {
|
|
1455
|
+
return ["strong", "a", "time", "span", "small", "b", "p", "ul"].includes(node.tag) ? { ...node, raw: `<p>${node.content}</p>` } : node;
|
|
1456
|
+
}
|
|
1457
|
+
function isSearchHeading(document) {
|
|
1458
|
+
return ["h1", "h2", "h3", "h4", "h5", "h6"].includes(document.type) && !!document.properties && !!document.properties["id"];
|
|
1459
|
+
}
|
|
1460
|
+
function normalizeAnchor(anchor) {
|
|
1461
|
+
return {
|
|
1462
|
+
anchorId: anchor.anchorId,
|
|
1463
|
+
anchor: anchor.anchor,
|
|
1464
|
+
title: anchor.title,
|
|
1465
|
+
type: anchor.type,
|
|
1466
|
+
...anchor.scope === void 0 ? {} : { scope: anchor.scope }
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
function recordingHighlight(settings, themes, store) {
|
|
1470
|
+
const records = [];
|
|
1471
|
+
return {
|
|
1472
|
+
records,
|
|
1473
|
+
next: () => {
|
|
1474
|
+
const record = { used: [], fresh: [], mismatched: [] };
|
|
1475
|
+
records.push(record);
|
|
1476
|
+
const mismatches = [];
|
|
1477
|
+
return {
|
|
1478
|
+
key: (block) => digestOf({ context: settings.context, block }),
|
|
1479
|
+
get: (key) => {
|
|
1480
|
+
const value = store.get(key);
|
|
1481
|
+
if (value !== void 0) record.used.push(key);
|
|
1482
|
+
return value;
|
|
1483
|
+
},
|
|
1484
|
+
set: (key, value) => {
|
|
1485
|
+
store.set(key, value);
|
|
1486
|
+
record.used.push(key);
|
|
1487
|
+
record.fresh.push([key, value]);
|
|
1488
|
+
store.prove();
|
|
1489
|
+
},
|
|
1490
|
+
loads: (requested) => requested.light === themes.light && requested.dark === themes.dark && store.proven(),
|
|
1491
|
+
verify: settings.verify,
|
|
1492
|
+
mismatch: (key) => {
|
|
1493
|
+
mismatches.push(key);
|
|
1494
|
+
record.mismatched.push(key);
|
|
1495
|
+
},
|
|
1496
|
+
mismatches
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
function serveHtmlThread(port) {
|
|
1502
|
+
const entries = /* @__PURE__ */ new Map();
|
|
1503
|
+
const proven = /* @__PURE__ */ new Set();
|
|
1504
|
+
let keywordSet;
|
|
1505
|
+
const reply = (value) => port.postMessage(encode(value));
|
|
1506
|
+
const render = async (job) => {
|
|
1507
|
+
const task = job["task"];
|
|
1508
|
+
const settings = job["highlight"];
|
|
1509
|
+
const recording = settings ? recordingHighlight(settings, task.themes, {
|
|
1510
|
+
get: (key) => entries.get(key),
|
|
1511
|
+
set: (key, value) => entries.set(key, value),
|
|
1512
|
+
proven: () => proven.has(settings.context),
|
|
1513
|
+
prove: () => proven.add(settings.context)
|
|
1514
|
+
}) : void 0;
|
|
1515
|
+
const documents = await renderDocuments(task, () => recording?.next());
|
|
1516
|
+
return { documents, ...recording ? { highlight: recording.records } : {} };
|
|
1517
|
+
};
|
|
1518
|
+
const link = async (job) => {
|
|
1519
|
+
if (!keywordSet || keywordSet.id !== job["keywords"])
|
|
1520
|
+
throw new Error(`Unknown keyword set ${String(job["keywords"])}`);
|
|
1521
|
+
const bindings = keywordSet.bindings;
|
|
1522
|
+
return linkDocument(job["task"], (key) => bindings.get(key));
|
|
1523
|
+
};
|
|
1524
|
+
port.on("message", (message) => {
|
|
1525
|
+
let id;
|
|
1526
|
+
void (async () => {
|
|
1527
|
+
try {
|
|
1528
|
+
const job = decode(message);
|
|
1529
|
+
id = job["id"];
|
|
1530
|
+
switch (job["type"]) {
|
|
1531
|
+
case "highlight": {
|
|
1532
|
+
if (job["reset"] === true) entries.clear();
|
|
1533
|
+
for (const [key, value] of job["entries"])
|
|
1534
|
+
entries.set(key, value);
|
|
1535
|
+
if (job["proven"] === true) proven.add(job["context"]);
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
case "keywords":
|
|
1539
|
+
keywordSet = {
|
|
1540
|
+
id: job["id"],
|
|
1541
|
+
bindings: bindingsOf(job["keywords"])
|
|
1542
|
+
};
|
|
1543
|
+
return;
|
|
1544
|
+
case "warm": {
|
|
1545
|
+
const cache = {
|
|
1546
|
+
key: () => "",
|
|
1547
|
+
get: () => void 0,
|
|
1548
|
+
set: () => void 0,
|
|
1549
|
+
loads: () => false,
|
|
1550
|
+
verify: false,
|
|
1551
|
+
mismatch: () => void 0,
|
|
1552
|
+
mismatches: []
|
|
1553
|
+
};
|
|
1554
|
+
await renderDocuments(
|
|
1555
|
+
{
|
|
1556
|
+
documents: [{ html: WARM_DOCUMENT }],
|
|
1557
|
+
themes: job["themes"]
|
|
1558
|
+
},
|
|
1559
|
+
() => job["cache"] === true ? cache : void 0
|
|
1560
|
+
);
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
case "render":
|
|
1564
|
+
reply({ type: "done", id, result: await render(job) });
|
|
1565
|
+
return;
|
|
1566
|
+
case "link":
|
|
1567
|
+
reply({ type: "done", id, result: await link(job) });
|
|
1568
|
+
return;
|
|
1569
|
+
default:
|
|
1570
|
+
throw new Error(`Unknown render thread job ${String(job["type"])}`);
|
|
1571
|
+
}
|
|
1572
|
+
} catch (error) {
|
|
1573
|
+
reply({ type: "failed", id: id ?? null, message: String(error) });
|
|
1574
|
+
}
|
|
1575
|
+
})();
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
var htmlUtilities, notAborted, WARM_DOCUMENT;
|
|
1579
|
+
var init_html_pipeline = __esm({
|
|
1580
|
+
"libs/builder/generator/content/html-pipeline.ts"() {
|
|
1581
|
+
"use strict";
|
|
1582
|
+
init_canonical();
|
|
1583
|
+
init_protocol();
|
|
1584
|
+
htmlUtilities = () => Promise.resolve().then(() => (init_utils(), utils_exports));
|
|
1585
|
+
notAborted = () => false;
|
|
1586
|
+
WARM_DOCUMENT = '<pre><code class="language-ts">const warm = 1;</code></pre>';
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1589
|
+
|
|
1590
|
+
// libs/builder/generator/content/html-worker.ts
|
|
1591
|
+
import { parentPort } from "node:worker_threads";
|
|
1592
|
+
var require_html_worker = __commonJS({
|
|
1593
|
+
"libs/builder/generator/content/html-worker.ts"() {
|
|
1594
|
+
init_html_pipeline();
|
|
1595
|
+
if (parentPort) serveHtmlThread(parentPort);
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
export default require_html_worker();
|