chrome-devtools-frontend 1.0.944427 → 1.0.944903
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/config/gni/devtools_grd_files.gni +3 -0
- package/front_end/core/common/ParsedURL.ts +1 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +5 -5
- package/front_end/core/i18n/locales/en-US.json +3 -15
- package/front_end/core/i18n/locales/en-XL.json +15 -27
- package/front_end/core/protocol_client/NodeURL.ts +1 -0
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +2 -3
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +2 -3
- package/front_end/core/sdk/Cookie.ts +17 -0
- package/front_end/core/sdk/CookieModel.ts +1 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -4
- package/front_end/core/sdk/NetworkManager.ts +4 -1
- package/front_end/core/sdk/NetworkRequest.ts +2 -2
- package/front_end/core/sdk/Resource.ts +2 -2
- package/front_end/core/sdk/Script.ts +2 -3
- package/front_end/models/bindings/BreakpointManager.ts +3 -4
- package/front_end/models/bindings/ResourceMapping.ts +1 -2
- package/front_end/models/bindings/StylesSourceMapping.ts +1 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +7 -6
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +10 -6
- package/front_end/models/persistence/PersistenceActions.ts +4 -1
- package/front_end/models/persistence/PlatformFileSystem.ts +3 -4
- package/front_end/models/text_utils/ContentProvider.ts +1 -2
- package/front_end/models/text_utils/StaticContentProvider.ts +2 -3
- package/front_end/models/workspace/UISourceCode.ts +2 -2
- package/front_end/panels/animation/animationTimeline.css +2 -0
- package/front_end/panels/application/ReportingApiView.ts +15 -1
- package/front_end/panels/application/components/EndpointsGrid.ts +63 -4
- package/front_end/panels/application/components/FrameDetailsView.ts +21 -34
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +1 -1
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/NavigatorView.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +3 -34
- package/front_end/panels/timeline/TimelineUIUtils.ts +51 -3
- package/front_end/services/window_bounds/WindowBoundsService.ts +27 -0
- package/front_end/services/window_bounds/window_bounds.ts +9 -0
- package/front_end/third_party/codemirror.next/bundle.ts +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +8 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/lit-html/README.chromium +2 -2
- package/front_end/third_party/lit-html/package/CHANGELOG.md +216 -28
- package/front_end/third_party/lit-html/package/LICENSE +9 -9
- package/front_end/third_party/lit-html/package/README.md +12 -162
- package/front_end/third_party/lit-html/package/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/async-directive.js +2 -7
- package/front_end/third_party/lit-html/package/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts +23 -54
- package/front_end/third_party/lit-html/package/development/async-directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/async-directive.js +44 -194
- package/front_end/third_party/lit-html/package/development/async-directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/development/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive-helpers.js +25 -9
- package/front_end/third_party/lit-html/package/development/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/development/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directive.js +6 -1
- package/front_end/third_party/lit-html/package/development/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/development/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-append.js +17 -58
- package/front_end/third_party/lit-html/package/development/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/development/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js +57 -37
- package/front_end/third_party/lit-html/package/development/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/development/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/cache.js +4 -6
- package/front_end/third_party/lit-html/package/development/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/development/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/class-map.js +17 -7
- package/front_end/third_party/lit-html/package/development/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/guard.js +3 -2
- package/front_end/third_party/lit-html/package/development/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/development/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/live.js +5 -7
- package/front_end/third_party/lit-html/package/development/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js +85 -0
- package/front_end/third_party/lit-html/package/development/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/ref.js +13 -11
- package/front_end/third_party/lit-html/package/development/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/development/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/repeat.js +23 -9
- package/front_end/third_party/lit-html/package/development/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/style-map.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/development/directives/template-content.js +1 -2
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js +7 -5
- package/front_end/third_party/lit-html/package/development/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js +3 -0
- package/front_end/third_party/lit-html/package/development/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/development/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/directives/until.js +63 -23
- package/front_end/third_party/lit-html/package/development/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js +9 -8
- package/front_end/third_party/lit-html/package/development/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/development/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/lit-html.js +249 -76
- package/front_end/third_party/lit-html/package/development/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/development/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/polyfill-support.js +40 -21
- package/front_end/third_party/lit-html/package/development/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/development/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js +11 -3
- package/front_end/third_party/lit-html/package/development/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/development/static.js +6 -5
- package/front_end/third_party/lit-html/package/development/static.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts +6 -5
- package/front_end/third_party/lit-html/package/directive-helpers.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive-helpers.js +2 -2
- package/front_end/third_party/lit-html/package/directive-helpers.js.map +1 -1
- package/front_end/third_party/lit-html/package/directive.d.ts +3 -16
- package/front_end/third_party/lit-html/package/directive.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directive.js +1 -1
- package/front_end/third_party/lit-html/package/directive.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts +7 -14
- package/front_end/third_party/lit-html/package/directives/async-append.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-append.js +2 -6
- package/front_end/third_party/lit-html/package/directives/async-append.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts +9 -14
- package/front_end/third_party/lit-html/package/directives/async-replace.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/async-replace.js +2 -5
- package/front_end/third_party/lit-html/package/directives/async-replace.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.d.ts +2 -3
- package/front_end/third_party/lit-html/package/directives/cache.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/cache.js +2 -5
- package/front_end/third_party/lit-html/package/directives/cache.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts +2 -2
- package/front_end/third_party/lit-html/package/directives/class-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/class-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/class-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.d.ts +3 -2
- package/front_end/third_party/lit-html/package/directives/guard.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/guard.js +2 -4
- package/front_end/third_party/lit-html/package/directives/guard.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.d.ts +4 -3
- package/front_end/third_party/lit-html/package/directives/live.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/live.js +1 -4
- package/front_end/third_party/lit-html/package/directives/live.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts +58 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.d.ts.map +1 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js +7 -0
- package/front_end/third_party/lit-html/package/directives/private-async-helpers.js.map +1 -0
- package/front_end/third_party/lit-html/package/directives/ref.d.ts +14 -11
- package/front_end/third_party/lit-html/package/directives/ref.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/ref.js +2 -5
- package/front_end/third_party/lit-html/package/directives/ref.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts +8 -4
- package/front_end/third_party/lit-html/package/directives/repeat.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/repeat.js +2 -5
- package/front_end/third_party/lit-html/package/directives/repeat.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/style-map.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/style-map.js +2 -4
- package/front_end/third_party/lit-html/package/directives/style-map.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/template-content.d.ts +1 -2
- package/front_end/third_party/lit-html/package/directives/template-content.js +2 -4
- package/front_end/third_party/lit-html/package/directives/template-content.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts +6 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js +2 -4
- package/front_end/third_party/lit-html/package/directives/unsafe-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts +4 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/unsafe-svg.js.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.d.ts +12 -8
- package/front_end/third_party/lit-html/package/directives/until.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/directives/until.js +2 -6
- package/front_end/third_party/lit-html/package/directives/until.js.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/experimental-hydrate.js +2 -5
- package/front_end/third_party/lit-html/package/experimental-hydrate.js.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.d.ts +81 -136
- package/front_end/third_party/lit-html/package/lit-html.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js +1 -1
- package/front_end/third_party/lit-html/package/lit-html.js.map +1 -1
- package/front_end/third_party/lit-html/package/package.json +75 -24
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts +1 -41
- package/front_end/third_party/lit-html/package/polyfill-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js +1 -1
- package/front_end/third_party/lit-html/package/polyfill-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts +12 -10
- package/front_end/third_party/lit-html/package/private-ssr-support.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/private-ssr-support.js +2 -2
- package/front_end/third_party/lit-html/package/private-ssr-support.js.map +1 -1
- package/front_end/third_party/lit-html/package/static.d.ts.map +1 -1
- package/front_end/third_party/lit-html/package/static.js +1 -1
- package/front_end/third_party/lit-html/package/static.js.map +1 -1
- package/front_end/third_party/marked/README.chromium +2 -2
- package/front_end/third_party/marked/marked.ts +2 -2
- package/front_end/third_party/marked/package/README.md +7 -1
- package/front_end/third_party/marked/package/bin/marked.js +214 -0
- package/front_end/third_party/marked/package/lib/marked.cjs +2907 -0
- package/front_end/third_party/marked/package/lib/marked.esm.d.ts +1 -3
- package/front_end/third_party/marked/package/lib/marked.esm.js +627 -586
- package/front_end/third_party/marked/package/lib/marked.umd.js +2913 -0
- package/front_end/third_party/marked/package/man/marked.1 +5 -24
- package/front_end/third_party/marked/package/man/marked.1.txt +21 -31
- package/front_end/third_party/marked/package/marked.min.js +1 -1
- package/front_end/third_party/marked/package/package.json +41 -32
- package/front_end/third_party/marked/package/src/Lexer.js +109 -108
- package/front_end/third_party/marked/package/src/Parser.js +38 -15
- package/front_end/third_party/marked/package/src/Renderer.js +5 -5
- package/front_end/third_party/marked/package/src/Slugger.js +2 -2
- package/front_end/third_party/marked/package/src/TextRenderer.js +2 -2
- package/front_end/third_party/marked/package/src/Tokenizer.js +215 -190
- package/front_end/third_party/marked/package/src/defaults.js +6 -9
- package/front_end/third_party/marked/package/src/helpers.js +16 -27
- package/front_end/third_party/marked/package/src/marked.js +146 -63
- package/front_end/third_party/marked/package/src/rules.js +20 -45
- package/front_end/third_party/wasmparser/README.chromium +2 -2
- package/front_end/third_party/wasmparser/package/.github/workflows/main.yml +47 -0
- package/front_end/third_party/wasmparser/package/CHANGELOG.md +12 -0
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/cjs/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js +53 -53
- package/front_end/third_party/wasmparser/package/dist/esm/WasmParser.js.map +1 -1
- package/front_end/third_party/wasmparser/package/package.json +1 -1
- package/front_end/third_party/wasmparser/package/src/WasmParser.ts +53 -53
- package/front_end/ui/components/text_editor/TextEditor.ts +29 -0
- package/front_end/ui/components/text_editor/config.ts +4 -2
- package/front_end/ui/legacy/ViewManager.ts +6 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +20 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyfill-support.js","sourceRoot":"","sources":["../src/polyfill-support.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAyEH,0EAA0E;AAC1E,SAAS;AACT,IAAM,YAAY,GAAgB,IAAI,GAAG,EAAE,CAAC;AAC5C,+EAA+E;AAC/E,2CAA2C;AAC3C,IAAM,aAAa,GAA0B,IAAI,GAAG,EAAE,CAAC;AAEvD,IAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;GAIG;AACH,8DAA8D;AAC9D,YAAC,UAAkB,EAAC,wBAAwB,wCAAxB,wBAAwB,IAAM,UAChD,QAAsC,EACtC,SAAwC;;IAExC,yEAAyE;IACzE,gEAAgE;IAChE,uDAAuD;IACvD,IACE,MAAM,CAAC,QAAQ,KAAK,SAAS;QAC7B,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC5D;QACA,OAAO;KACR;IAED,eAAe;IACf,wDAAwD;IACxD,4CAA4C;IAC5C,KAAK;IAEL,IAAM,IAAI,GACR,uBAAuB,WACvB,MAAM,CAAC,QAAQ,0CAAE,KAAK,CAAA;QACtB,OAAA,MAAM,CAAC,QAAQ,0CAAE,OAAO,MAAK,IAAI;QAC/B,CAAC,CA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AAC;AAEF,IAAI,uBAAuB,EAAE;IAC3B,iGAAiG;IAChG,UAAkB,CACjB,wBAAwB,CACzB,CAAC,gBAAgB,GAAG,uBAAuB,CAAC;CAC9C","sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * lit-html patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill.\n * Scoping classes are added to DOM nodes to facilitate CSS scoping that\n * simulates the style scoping Shadow DOM provides. ShadyDOM does this scoping\n * to all elements added to the DOM. This module provides an important\n * optimization for this process by pre-scoping lit-html template\n * DOM. This means ShadyDOM does not have to scope each instance of the\n * template DOM. Instead, each template is scoped only once.\n *\n * Creating scoped CSS is not covered by this module. It is, however, integrated\n * into the lit-element and @lit/reactive-element packages. See the ShadyCSS docs\n * for how to apply scoping to CSS:\n * https://github.com/webcomponents/polyfills/tree/master/packages/shadycss#usage.\n *\n * @packageDocumentation\n */\n\ninterface RenderOptions {\n readonly renderBefore?: ChildNode | null;\n scope?: string;\n}\n\ninterface ShadyTemplateResult {\n strings: TemplateStringsArray;\n _$litType$?: string;\n}\n\n// Note, this is a dummy type as the full type here is big.\ninterface Directive {\n __directive?: Directive;\n}\n\ninterface DirectiveParent {\n _$parent?: DirectiveParent;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\ninterface PatchableChildPartConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableChildPart;\n}\n\ninterface PatchableChildPart {\n __directive?: Directive;\n _$committedValue: unknown;\n _$startNode: ChildNode;\n _$endNode: ChildNode | null;\n options: RenderOptions;\n _$setValue(value: unknown, directiveParent: DirectiveParent): void;\n _$getTemplate(result: ShadyTemplateResult): HTMLTemplateElement;\n}\n\ninterface PatchableTemplate {\n el: HTMLTemplateElement;\n}\n\ninterface PatchableTemplateConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableTemplate;\n createElement(html: string, options?: RenderOptions): HTMLTemplateElement;\n}\n\ninterface PatchableTemplateInstance {\n _$template: PatchableTemplate;\n}\n\n// Scopes that have had styling prepared. Note, must only be done once per\n// scope.\nconst styledScopes: Set<string> = new Set();\n// Map of css per scope. This is collected during first scope render, used when\n// styling is prepared, and then discarded.\nconst scopeCssStore: Map<string, string[]> = new Map();\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\n/**\n * lit-html patches. These properties cannot be renamed.\n * * ChildPart.prototype._$getTemplate\n * * ChildPart.prototype._$setValue\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(globalThis as any)['litHtmlPlatformSupport'] ??= (\n Template: PatchableTemplateConstructor,\n ChildPart: PatchableChildPartConstructor\n) => {\n // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n // We test at the point of patching, which makes it safe to load\n // webcomponentsjs and polyfill-support in either order\n if (\n window.ShadyCSS === undefined ||\n (window.ShadyCSS.nativeShadow && !window.ShadyCSS.ApplyShim)\n ) {\n return;\n }\n\n // console.log(\n // '%c Making lit-html compatible with ShadyDOM/CSS.',\n // 'color: lightgreen; font-style: italic'\n // );\n\n const wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n const needsPrepareStyles = (name: string | undefined) =>\n name !== undefined && !styledScopes.has(name);\n\n const cssForScope = (name: string) => {\n let scopeCss = scopeCssStore.get(name);\n if (scopeCss === undefined) {\n scopeCssStore.set(name, (scopeCss = []));\n }\n return scopeCss;\n };\n\n const prepareStyles = (name: string, template: HTMLTemplateElement) => {\n // Get styles\n const scopeCss = cssForScope(name);\n const hasScopeCss = scopeCss.length !== 0;\n if (hasScopeCss) {\n const style = document.createElement('style');\n style.textContent = scopeCss.join('\\n');\n // Note, it's important to add the style to the *end* of the template so\n // it doesn't mess up part indices.\n template.content.appendChild(style);\n }\n // Mark this scope as styled.\n styledScopes.add(name);\n // Remove stored data since it's no longer needed.\n scopeCssStore.delete(name);\n // ShadyCSS removes scopes and removes the style under ShadyDOM and leaves\n // it under native Shadow DOM\n window.ShadyCSS!.prepareTemplateStyles(template, name);\n // Note, under native Shadow DOM, the style is added to the beginning of the\n // template. It must be moved to the *end* of the template so it doesn't\n // mess up part indices.\n if (hasScopeCss && window.ShadyCSS!.nativeShadow) {\n template.content.appendChild(template.content.querySelector('style')!);\n }\n };\n\n const scopedTemplateCache = new Map<\n string | undefined,\n Map<TemplateStringsArray, PatchableTemplate>\n >();\n\n /**\n * Override to extract style elements from the template\n * and store all style.textContent in the shady scope data.\n * Note, it's ok to patch Template since it's only used via ChildPart.\n */\n const originalCreateElement = Template.createElement;\n Template.createElement = function (html: string, options?: RenderOptions) {\n const element = originalCreateElement.call(Template, html, options);\n const scope = options?.scope;\n if (scope !== undefined) {\n if (!window.ShadyCSS!.nativeShadow) {\n window.ShadyCSS!.prepareTemplateDom(element, scope);\n }\n const scopeCss = cssForScope(scope);\n // Remove styles and store textContent.\n const styles = element.content.querySelectorAll(\n 'style'\n ) as NodeListOf<HTMLStyleElement>;\n // Store the css in this template in the scope css and remove the <style>\n // from the template _before_ the node-walk captures part indices\n scopeCss.push(\n ...Array.from(styles).map((style) => {\n style.parentNode?.removeChild(style);\n return style.textContent!;\n })\n );\n }\n return element;\n };\n\n const renderContainer = document.createDocumentFragment();\n const renderContainerMarker = document.createComment('');\n\n const childPartProto = ChildPart.prototype;\n /**\n * Patch to apply gathered css via ShadyCSS. This is done only once per scope.\n */\n const setValue = childPartProto._$setValue;\n childPartProto._$setValue = function (\n this: PatchableChildPart,\n value: unknown,\n directiveParent: DirectiveParent = this\n ) {\n const container = wrap(this._$startNode).parentNode!;\n const scope = this.options?.scope;\n if (container instanceof ShadowRoot && needsPrepareStyles(scope)) {\n // Note, @apply requires outer => inner scope rendering on initial\n // scope renders to apply property values correctly. Style preparation\n // is tied to rendering into `shadowRoot`'s and this is typically done by\n // custom elements. If this is done in `connectedCallback`, as is typical,\n // the code below ensures the right order since content is rendered\n // into a fragment first so the hosting element can prepare styles first.\n // If rendering is done in the constructor, this won't work, but that's\n // not supported in ShadyDOM anyway.\n const startNode = this._$startNode;\n const endNode = this._$endNode;\n\n // Temporarily move this part into the renderContainer.\n renderContainer.appendChild(renderContainerMarker);\n this._$startNode = renderContainerMarker;\n this._$endNode = null;\n\n // Note, any nested template results render here and their styles will\n // be extracted and collected.\n setValue.call(this, value, directiveParent);\n\n // Get the template for this result or create a dummy one if a result\n // is not being rendered.\n const template = (value as ShadyTemplateResult)?._$litType$\n ? (this._$committedValue as PatchableTemplateInstance)._$template.el\n : document.createElement('template');\n prepareStyles(scope!, template);\n\n // Note, this is the temporary startNode.\n renderContainer.removeChild(renderContainerMarker);\n // When using native Shadow DOM, include prepared style in shadowRoot.\n if (window.ShadyCSS?.nativeShadow) {\n const style = template.content.querySelector('style');\n if (style !== null) {\n renderContainer.appendChild(style.cloneNode(true));\n }\n }\n container.insertBefore(renderContainer, endNode);\n // Move part back to original container.\n this._$startNode = startNode;\n this._$endNode = endNode;\n } else {\n setValue.call(this, value, directiveParent);\n }\n };\n\n /**\n * Patch ChildPart._$getTemplate to look up templates in a cache bucketed\n * by element name.\n */\n childPartProto._$getTemplate = function (\n this: PatchableChildPart,\n result: ShadyTemplateResult\n ) {\n const scope = this.options?.scope;\n let templateCache = scopedTemplateCache.get(scope);\n if (templateCache === undefined) {\n scopedTemplateCache.set(scope, (templateCache = new Map()));\n }\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(\n result.strings,\n (template = new Template(result, this.options))\n );\n }\n return template;\n };\n};\n\nif (ENABLE_SHADYDOM_NOPATCH) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n (globalThis as any)[\n 'litHtmlPlatformSupport'\n ].noPatchSupported = ENABLE_SHADYDOM_NOPATCH;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"polyfill-support.js","sourceRoot":"","sources":["../src/polyfill-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AA4EH,0EAA0E;AAC1E,SAAS;AACT,IAAM,YAAY,GAAgB,IAAI,GAAG,EAAE,CAAC;AAC5C,+EAA+E;AAC/E,2CAA2C;AAC3C,IAAM,aAAa,GAA0B,IAAI,GAAG,EAAE,CAAC;AAEvD,IAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC,sEAAsE;AACtE,WAAW;AACX,kCAAkC;AAClC,IAAI,QAAQ,GAAG,IAAI,CAAC;AAEpB;;;;GAIG;AACH,IAAM,eAAe,GAA+C,UAClE,QAAsC,EACtC,SAAwC;;IAExC,yEAAyE;IACzE,gEAAgE;IAChE,uDAAuD;IACvD,IACE,MAAM,CAAC,QAAQ,KAAK,SAAS;QAC7B,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAC5D;QACA,OAAO;KACR;IAED,eAAe;IACf,wDAAwD;IACxD,4CAA4C;IAC5C,KAAK;IAEL,IAAM,IAAI,GACR,uBAAuB;SACvB,MAAA,MAAM,CAAC,QAAQ,0CAAE,KAAK,CAAA;QACtB,CAAA,MAAA,MAAM,CAAC,QAAQ,0CAAE,OAAO,MAAK,IAAI;QAC/B,CAAC,CAAC,MAAM,CAAC,QAAS,CAAC,IAAI;QACvB,CAAC,CAAC,UAAC,IAAU,IAAK,OAAA,IAAI,EAAJ,CAAI,CAAC;IAE3B,IAAM,kBAAkB,GAAG,UAAC,IAAwB;QAClD,OAAA,IAAI,KAAK,SAAS,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;IAA7C,CAA6C,CAAC;IAEhD,IAAM,WAAW,GAAG,UAAC,IAAY;QAC/B,IAAI,QAAQ,GAAG,aAA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GAAG,uBAAuB,CAAC;CAC5D;AAED,IAAI,QAAQ,EAAE;IACZ,MAAA,UAAU,CAAC,6BAA6B,oCAAxC,UAAU,CAAC,6BAA6B,GAAK,eAAe,EAAC;CAC9D;KAAM;IACL,MAAA,UAAU,CAAC,sBAAsB,oCAAjC,UAAU,CAAC,sBAAsB,GAAK,eAAe,EAAC;CACvD","sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * lit-html patch to support browsers without native web components.\n *\n * This module should be used in addition to loading the web components\n * polyfills via @webcomponents/webcomponentjs. When using those polyfills\n * support for polyfilled Shadow DOM is automatic via the ShadyDOM polyfill.\n * Scoping classes are added to DOM nodes to facilitate CSS scoping that\n * simulates the style scoping Shadow DOM provides. ShadyDOM does this scoping\n * to all elements added to the DOM. This module provides an important\n * optimization for this process by pre-scoping lit-html template\n * DOM. This means ShadyDOM does not have to scope each instance of the\n * template DOM. Instead, each template is scoped only once.\n *\n * Creating scoped CSS is not covered by this module. It is, however, integrated\n * into the lit-element and @lit/reactive-element packages. See the ShadyCSS docs\n * for how to apply scoping to CSS:\n * https://github.com/webcomponents/polyfills/tree/master/packages/shadycss#usage.\n *\n * @packageDocumentation\n */\n\nexport {};\n\ninterface RenderOptions {\n readonly renderBefore?: ChildNode | null;\n scope?: string;\n}\n\ninterface ShadyTemplateResult {\n strings: TemplateStringsArray;\n // This property needs to remain unminified.\n ['_$litType$']?: string;\n}\n\n// Note, this is a dummy type as the full type here is big.\ninterface Directive {\n __directive?: Directive;\n}\n\ninterface DirectiveParent {\n _$parent?: DirectiveParent;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\ninterface PatchableChildPartConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableChildPart;\n}\n\ninterface PatchableChildPart {\n __directive?: Directive;\n _$committedValue: unknown;\n _$startNode: ChildNode;\n _$endNode: ChildNode | null;\n options: RenderOptions;\n _$setValue(value: unknown, directiveParent: DirectiveParent): void;\n _$getTemplate(result: ShadyTemplateResult): HTMLTemplateElement;\n}\n\ninterface PatchableTemplate {\n el: HTMLTemplateElement;\n}\n\ninterface PatchableTemplateConstructor {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-misused-new\n new (...args: any[]): PatchableTemplate;\n createElement(html: string, options?: RenderOptions): HTMLTemplateElement;\n}\n\ninterface PatchableTemplateInstance {\n _$template: PatchableTemplate;\n}\n\n// Scopes that have had styling prepared. Note, must only be done once per\n// scope.\nconst styledScopes: Set<string> = new Set();\n// Map of css per scope. This is collected during first scope render, used when\n// styling is prepared, and then discarded.\nconst scopeCssStore: Map<string, string[]> = new Map();\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\n// Note, explicitly use `var` here so that this can be re-defined when\n// bundled.\n// eslint-disable-next-line no-var\nvar DEV_MODE = true;\n\n/**\n * lit-html patches. These properties cannot be renamed.\n * * ChildPart.prototype._$getTemplate\n * * ChildPart.prototype._$setValue\n */\nconst polyfillSupport: NonNullable<typeof litHtmlPolyfillSupport> = (\n Template: PatchableTemplateConstructor,\n ChildPart: PatchableChildPartConstructor\n) => {\n // polyfill-support is only needed if ShadyCSS or the ApplyShim is in use\n // We test at the point of patching, which makes it safe to load\n // webcomponentsjs and polyfill-support in either order\n if (\n window.ShadyCSS === undefined ||\n (window.ShadyCSS.nativeShadow && !window.ShadyCSS.ApplyShim)\n ) {\n return;\n }\n\n // console.log(\n // '%c Making lit-html compatible with ShadyDOM/CSS.',\n // 'color: lightgreen; font-style: italic'\n // );\n\n const wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n const needsPrepareStyles = (name: string | undefined) =>\n name !== undefined && !styledScopes.has(name);\n\n const cssForScope = (name: string) => {\n let scopeCss = scopeCssStore.get(name);\n if (scopeCss === undefined) {\n scopeCssStore.set(name, (scopeCss = []));\n }\n return scopeCss;\n };\n\n const prepareStyles = (name: string, template: HTMLTemplateElement) => {\n // Get styles\n const scopeCss = cssForScope(name);\n const hasScopeCss = scopeCss.length !== 0;\n if (hasScopeCss) {\n const style = document.createElement('style');\n style.textContent = scopeCss.join('\\n');\n // Note, it's important to add the style to the *end* of the template so\n // it doesn't mess up part indices.\n template.content.appendChild(style);\n }\n // Mark this scope as styled.\n styledScopes.add(name);\n // Remove stored data since it's no longer needed.\n scopeCssStore.delete(name);\n // ShadyCSS removes scopes and removes the style under ShadyDOM and leaves\n // it under native Shadow DOM\n window.ShadyCSS!.prepareTemplateStyles(template, name);\n // Note, under native Shadow DOM, the style is added to the beginning of the\n // template. It must be moved to the *end* of the template so it doesn't\n // mess up part indices.\n if (hasScopeCss && window.ShadyCSS!.nativeShadow) {\n // If there were styles but the CSS text was empty, ShadyCSS will\n // eliminate the style altogether, so the style here could be null\n const style = template.content.querySelector('style');\n if (style !== null) {\n template.content.appendChild(style);\n }\n }\n };\n\n const scopedTemplateCache = new Map<\n string | undefined,\n Map<TemplateStringsArray, PatchableTemplate>\n >();\n\n /**\n * Override to extract style elements from the template\n * and store all style.textContent in the shady scope data.\n * Note, it's ok to patch Template since it's only used via ChildPart.\n */\n const originalCreateElement = Template.createElement;\n Template.createElement = function (html: string, options?: RenderOptions) {\n const element = originalCreateElement.call(Template, html, options);\n const scope = options?.scope;\n if (scope !== undefined) {\n if (!window.ShadyCSS!.nativeShadow) {\n window.ShadyCSS!.prepareTemplateDom(element, scope);\n }\n // Process styles only if this scope is being prepared. Otherwise,\n // leave styles as is for back compat with Lit1.\n if (needsPrepareStyles(scope)) {\n const scopeCss = cssForScope(scope);\n // Remove styles and store textContent.\n const styles = element.content.querySelectorAll(\n 'style'\n ) as NodeListOf<HTMLStyleElement>;\n // Store the css in this template in the scope css and remove the <style>\n // from the template _before_ the node-walk captures part indices\n scopeCss.push(\n ...Array.from(styles).map((style) => {\n style.parentNode?.removeChild(style);\n return style.textContent!;\n })\n );\n }\n }\n return element;\n };\n\n const renderContainer = document.createDocumentFragment();\n const renderContainerMarker = document.createComment('');\n\n const childPartProto = ChildPart.prototype;\n /**\n * Patch to apply gathered css via ShadyCSS. This is done only once per scope.\n */\n const setValue = childPartProto._$setValue;\n childPartProto._$setValue = function (\n this: PatchableChildPart,\n value: unknown,\n directiveParent: DirectiveParent = this\n ) {\n const container = wrap(this._$startNode).parentNode!;\n const scope = this.options?.scope;\n if (container instanceof ShadowRoot && needsPrepareStyles(scope)) {\n // Note, @apply requires outer => inner scope rendering on initial\n // scope renders to apply property values correctly. Style preparation\n // is tied to rendering into `shadowRoot`'s and this is typically done by\n // custom elements. If this is done in `connectedCallback`, as is typical,\n // the code below ensures the right order since content is rendered\n // into a fragment first so the hosting element can prepare styles first.\n // If rendering is done in the constructor, this won't work, but that's\n // not supported in ShadyDOM anyway.\n const startNode = this._$startNode;\n const endNode = this._$endNode;\n\n // Temporarily move this part into the renderContainer.\n renderContainer.appendChild(renderContainerMarker);\n this._$startNode = renderContainerMarker;\n this._$endNode = null;\n\n // Note, any nested template results render here and their styles will\n // be extracted and collected.\n setValue.call(this, value, directiveParent);\n\n // Get the template for this result or create a dummy one if a result\n // is not being rendered.\n // This property needs to remain unminified.\n const template = (value as ShadyTemplateResult)?.['_$litType$']\n ? (this._$committedValue as PatchableTemplateInstance)._$template.el\n : document.createElement('template');\n prepareStyles(scope!, template);\n\n // Note, this is the temporary startNode.\n renderContainer.removeChild(renderContainerMarker);\n // When using native Shadow DOM, include prepared style in shadowRoot.\n if (window.ShadyCSS?.nativeShadow) {\n const style = template.content.querySelector('style');\n if (style !== null) {\n renderContainer.appendChild(style.cloneNode(true));\n }\n }\n container.insertBefore(renderContainer, endNode);\n // Move part back to original container.\n this._$startNode = startNode;\n this._$endNode = endNode;\n } else {\n setValue.call(this, value, directiveParent);\n }\n };\n\n /**\n * Patch ChildPart._$getTemplate to look up templates in a cache bucketed\n * by element name.\n */\n childPartProto._$getTemplate = function (\n this: PatchableChildPart,\n result: ShadyTemplateResult\n ) {\n const scope = this.options?.scope;\n let templateCache = scopedTemplateCache.get(scope);\n if (templateCache === undefined) {\n scopedTemplateCache.set(scope, (templateCache = new Map()));\n }\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(\n result.strings,\n (template = new Template(result, this.options))\n );\n }\n return template;\n };\n};\n\nif (ENABLE_SHADYDOM_NOPATCH) {\n polyfillSupport.noPatchSupported = ENABLE_SHADYDOM_NOPATCH;\n}\n\nif (DEV_MODE) {\n globalThis.litHtmlPolyfillSupportDevMode ??= polyfillSupport;\n} else {\n globalThis.litHtmlPolyfillSupport ??= polyfillSupport;\n}\n"]}
|
|
@@ -3,27 +3,26 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { AttributePart, Part } from './lit-html.js';
|
|
6
|
+
import { Directive, PartInfo, DirectiveClass, DirectiveResult } from './directive.js';
|
|
7
|
+
import { AttributePart, Part, Disconnectable } from './lit-html.js';
|
|
9
8
|
export type { Template } from './lit-html.js';
|
|
10
9
|
/**
|
|
11
10
|
* END USERS SHOULD NOT RELY ON THIS OBJECT.
|
|
12
11
|
*
|
|
13
12
|
* We currently do not make a mangled rollup build of the lit-ssr code. In order
|
|
14
13
|
* to keep a number of (otherwise private) top-level exports mangled in the
|
|
15
|
-
* client side code, we export a _
|
|
14
|
+
* client side code, we export a _$LH object containing those members (or
|
|
16
15
|
* helper methods for accessing private fields of those members), and then
|
|
17
16
|
* re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
|
|
18
17
|
* client-side code is being used in `dev` mode or `prod` mode.
|
|
19
18
|
* @private
|
|
20
19
|
*/
|
|
21
|
-
export declare const _
|
|
20
|
+
export declare const _$LH: {
|
|
22
21
|
boundAttributeSuffix: string;
|
|
23
22
|
marker: string;
|
|
24
23
|
markerMatch: string;
|
|
25
24
|
HTML_RESULT: number;
|
|
26
|
-
getTemplateHtml: (strings: TemplateStringsArray, type: 1 | 2) => [TrustedHTML, (string | undefined)[]];
|
|
25
|
+
getTemplateHtml: (strings: TemplateStringsArray, type: 1 | 2) => [import("trusted-types/lib").TrustedHTML, (string | undefined)[]];
|
|
27
26
|
overrideDirectiveResolve: (directiveClass: new (part: PartInfo) => Directive & {
|
|
28
27
|
render(): unknown;
|
|
29
28
|
}, resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown) => {
|
|
@@ -32,15 +31,18 @@ export declare const _Σ: {
|
|
|
32
31
|
__part: Part;
|
|
33
32
|
__attributeIndex: number | undefined;
|
|
34
33
|
__directive?: Directive | undefined;
|
|
35
|
-
_$parent:
|
|
36
|
-
_$
|
|
37
|
-
_$
|
|
38
|
-
_$
|
|
34
|
+
_$parent: Disconnectable;
|
|
35
|
+
_$disconnectableChildren?: Set<Disconnectable> | undefined;
|
|
36
|
+
_$notifyDirectiveConnectionChanged?(isConnected: boolean): void;
|
|
37
|
+
readonly _$isConnected: boolean;
|
|
38
|
+
_$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
|
|
39
39
|
render: ((...props: unknown[]) => unknown) & (() => unknown);
|
|
40
40
|
update(_part: Part, props: unknown[]): unknown;
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
+
setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass): void;
|
|
43
44
|
getAttributePartCommittedValue: (part: AttributePart, value: unknown, index: number | undefined) => unknown;
|
|
45
|
+
connectedDisconnectable: (props?: object | undefined) => Disconnectable;
|
|
44
46
|
resolveDirective: (part: import("./lit-html.js").ChildPart | AttributePart | import("./lit-html.js").ElementPart, value: unknown, parent?: import("./lit-html.js").DirectiveParent, attributeIndex?: number | undefined) => unknown;
|
|
45
47
|
AttributePart: typeof AttributePart;
|
|
46
48
|
PropertyPart: typeof import("./lit-html.js").PropertyPart;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-ssr-support.d.ts","sourceRoot":"","sources":["../src/private-ssr-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"private-ssr-support.d.ts","sourceRoot":"","sources":["../src/private-ssr-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,aAAa,EAEb,IAAI,EACJ,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,YAAY,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI;;;;;;0DAOc,QAAQ,KAAK,SAAS,GAAG;QAAC,MAAM,IAAI,OAAO,CAAA;KAAC,iCACxC,SAAS,UAAU,OAAO,EAAE,KAAK,OAAO;mBAD5C,QAAQ;4BAKzB,SAAS,SACR,IAAI,UACH,OAAO,EAAE,GAChB,OAAO;;;;;;;;;gEARmD,OAAO;;;;6BAY/C,eAAe,kBAAkB,cAAc;2CAKhE,aAAa,SACZ,OAAO,SACP,MAAM,GAAG,SAAS;6DAYgB,cAAc;;;;;;;CAU1D,CAAC"}
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
import { _
|
|
6
|
+
import { _$LH as p, noChange, } from './lit-html.js';
|
|
7
7
|
/**
|
|
8
8
|
* END USERS SHOULD NOT RELY ON THIS OBJECT.
|
|
9
9
|
*
|
|
10
10
|
* We currently do not make a mangled rollup build of the lit-ssr code. In order
|
|
11
11
|
* to keep a number of (otherwise private) top-level exports mangled in the
|
|
12
|
-
* client side code, we export a _
|
|
12
|
+
* client side code, we export a _$LH object containing those members (or
|
|
13
13
|
* helper methods for accessing private fields of those members), and then
|
|
14
14
|
* re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
|
|
15
15
|
* client-side code is being used in `dev` mode or `prod` mode.
|
|
16
16
|
* @private
|
|
17
17
|
*/
|
|
18
|
-
export const _
|
|
18
|
+
export const _$LH = {
|
|
19
19
|
boundAttributeSuffix: p._boundAttributeSuffix,
|
|
20
20
|
marker: p._marker,
|
|
21
21
|
markerMatch: p._markerMatch,
|
|
@@ -26,6 +26,10 @@ export const _Σ = {
|
|
|
26
26
|
return resolveOverrideFn(this, values);
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
setDirectiveClass(value, directiveClass) {
|
|
30
|
+
// This property needs to remain unminified.
|
|
31
|
+
value['_$litDirective$'] = directiveClass;
|
|
32
|
+
},
|
|
29
33
|
getAttributePartCommittedValue: (part, value, index) => {
|
|
30
34
|
// Use the part setter to resolve directives/concatenate multiple parts
|
|
31
35
|
// into a final value (captured by passing in a commitValue override)
|
|
@@ -37,6 +41,10 @@ export const _Σ = {
|
|
|
37
41
|
part._$setValue(value, part, index);
|
|
38
42
|
return committedValue;
|
|
39
43
|
},
|
|
44
|
+
connectedDisconnectable: (props) => ({
|
|
45
|
+
...props,
|
|
46
|
+
_$isConnected: true,
|
|
47
|
+
}),
|
|
40
48
|
resolveDirective: p._resolveDirective,
|
|
41
49
|
AttributePart: p._AttributePart,
|
|
42
50
|
PropertyPart: p._PropertyPart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-ssr-support.js","sourceRoot":"","sources":["../src/private-ssr-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"private-ssr-support.js","sourceRoot":"","sources":["../src/private-ssr-support.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,OAAO,EACL,IAAI,IAAI,CAAC,EAET,QAAQ,GAGT,MAAM,eAAe,CAAC;AAGvB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB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CAAC","sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n Directive,\n PartInfo,\n DirectiveClass,\n DirectiveResult,\n} from './directive.js';\nimport {\n _$LH as p,\n AttributePart,\n noChange,\n Part,\n Disconnectable,\n} from './lit-html.js';\nexport type {Template} from './lit-html.js';\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n * @private\n */\nexport const _$LH = {\n boundAttributeSuffix: p._boundAttributeSuffix,\n marker: p._marker,\n markerMatch: p._markerMatch,\n HTML_RESULT: p._HTML_RESULT,\n getTemplateHtml: p._getTemplateHtml,\n overrideDirectiveResolve: (\n directiveClass: new (part: PartInfo) => Directive & {render(): unknown},\n resolveOverrideFn: (directive: Directive, values: unknown[]) => unknown\n ) =>\n class extends directiveClass {\n override _$resolve(\n this: Directive,\n _part: Part,\n values: unknown[]\n ): unknown {\n return resolveOverrideFn(this, values);\n }\n },\n setDirectiveClass(value: DirectiveResult, directiveClass: DirectiveClass) {\n // This property needs to remain unminified.\n value['_$litDirective$'] = directiveClass;\n },\n getAttributePartCommittedValue: (\n part: AttributePart,\n value: unknown,\n index: number | undefined\n ) => {\n // Use the part setter to resolve directives/concatenate multiple parts\n // into a final value (captured by passing in a commitValue override)\n let committedValue: unknown = noChange;\n // Note that _commitValue need not be in `stableProperties` because this\n // method is only run on `AttributePart`s created by lit-ssr using the same\n // version of the library as this file\n part._commitValue = (value: unknown) => (committedValue = value);\n part._$setValue(value, part, index);\n return committedValue;\n },\n connectedDisconnectable: (props?: object): Disconnectable => ({\n ...props,\n _$isConnected: true,\n }),\n resolveDirective: p._resolveDirective,\n AttributePart: p._AttributePart,\n PropertyPart: p._PropertyPart,\n BooleanAttributePart: p._BooleanAttributePart,\n EventPart: p._EventPart,\n ElementPart: p._ElementPart,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,OAAO,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM;;CAExC,CAAC;AAaH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,YACT,oBAAoB,aAClB,OAAO,EAAE;;CAMpB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,OAAO,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,UAAW,MAAM;;CAExC,CAAC;AAaH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,YACT,oBAAoB,aAClB,OAAO,EAAE;;CAMpB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,UAAU,YACX,eAAe,GAAG,cAAc,eAChC,oBAAoB,aAAa,OAAO,EAAE,KAAG,cA8CtD,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,IAAI,YAtDL,oBAAoB,aAAa,OAAO,EAAE,KAAG,cAsDjB,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,GAAG,YA9DJ,oBAAoB,aAAa,OAAO,EAAE,KAAG,cA8DnB,CAAC"}
|
|
@@ -19,11 +19,11 @@ import { html as coreHtml, svg as coreSvg } from './lit-html.js';
|
|
|
19
19
|
* since they effectively create a new template.
|
|
20
20
|
*/
|
|
21
21
|
export const unsafeStatic = (value) => ({
|
|
22
|
-
_$litStatic
|
|
22
|
+
['_$litStatic$']: value,
|
|
23
23
|
});
|
|
24
24
|
const textFromStatic = (value) => {
|
|
25
|
-
if (value
|
|
26
|
-
return value
|
|
25
|
+
if (value['_$litStatic$'] !== undefined) {
|
|
26
|
+
return value['_$litStatic$'];
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
throw new Error(`Value passed to 'literal' function must be a 'literal' result: ${value}. Use 'unsafeStatic' to pass non-literal values, but
|
|
@@ -45,7 +45,7 @@ const textFromStatic = (value) => {
|
|
|
45
45
|
* they effectively create a new template.
|
|
46
46
|
*/
|
|
47
47
|
export const literal = (strings, ...values) => ({
|
|
48
|
-
_$litStatic
|
|
48
|
+
['_$litStatic$']: values.reduce((acc, v, idx) => acc + textFromStatic(v) + strings[idx + 1], strings[0]),
|
|
49
49
|
});
|
|
50
50
|
const stringsCache = new Map();
|
|
51
51
|
/**
|
|
@@ -68,7 +68,8 @@ export const withStatic = (coreTag) => (strings, ...values) => {
|
|
|
68
68
|
// a single template string.
|
|
69
69
|
while (i < l &&
|
|
70
70
|
((dynamicValue = values[i]),
|
|
71
|
-
(staticValue = (_a = dynamicValue) === null || _a === void 0 ? void 0 : _a
|
|
71
|
+
(staticValue = (_a = dynamicValue) === null || _a === void 0 ? void 0 : _a['_$litStatic$'])) !==
|
|
72
|
+
undefined) {
|
|
72
73
|
s += staticValue + strings[++i];
|
|
73
74
|
hasStatics = true;
|
|
74
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.js","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,IAAI,OAAO,EAAiB,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC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AAC,CAAC;AACrC,CAAC,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport {html as coreHtml, svg as coreSvg, TemplateResult} from './lit-html.js';\n\n/**\n * Wraps a string so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Note that this function is unsafe to use on untrusted content, as it will be\n * directly parsed into HTML. Do not pass user input to this function\n * without sanitizing it.\n *\n * Static values can be changed, but they will cause a complete re-render\n * since they effectively create a new template.\n */\nexport const unsafeStatic = (value: string) => ({\n ['_$litStatic$']: value,\n});\n\nconst textFromStatic = (value: StaticValue) => {\n if (value['_$litStatic$'] !== undefined) {\n return value['_$litStatic$'];\n } else {\n throw new Error(\n `Value passed to 'literal' function must be a 'literal' result: ${value}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`\n );\n }\n};\n\n/**\n * Tags a string literal so that it behaves like part of the static template\n * strings instead of a dynamic value.\n *\n * The only values that may be used in template expressions are other tagged\n * `literal` results or `unsafeStatic` values (note that untrusted content\n * should never be passed to `unsafeStatic`).\n *\n * Users must take care to ensure that adding the static string to the template\n * results in well-formed HTML, or else templates may break unexpectedly.\n *\n * Static values can be changed, but they will cause a complete re-render since\n * they effectively create a new template.\n */\nexport const literal = (\n strings: TemplateStringsArray,\n ...values: unknown[]\n) => ({\n ['_$litStatic$']: values.reduce(\n (acc, v, idx) => acc + textFromStatic(v as StaticValue) + strings[idx + 1],\n strings[0]\n ),\n});\n\ntype StaticValue = ReturnType<typeof unsafeStatic>;\n\nconst stringsCache = new Map<string, TemplateStringsArray>();\n\n/**\n * Wraps a lit-html template tag (`html` or `svg`) to add static value support.\n */\nexport const withStatic =\n (coreTag: typeof coreHtml | typeof coreSvg) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult => {\n const l = values.length;\n let staticValue: string | undefined;\n let dynamicValue: unknown;\n const staticStrings: Array<string> = [];\n const dynamicValues: Array<unknown> = [];\n let i = 0;\n let hasStatics = false;\n let s: string;\n\n while (i < l) {\n s = strings[i];\n // Collect any unsafeStatic values, and their following template strings\n // so that we treat a run of template strings and unsafe static values as\n // a single template string.\n while (\n i < l &&\n ((dynamicValue = values[i]),\n (staticValue = (dynamicValue as StaticValue)?.['_$litStatic$'])) !==\n undefined\n ) {\n s += staticValue + strings[++i];\n hasStatics = true;\n }\n dynamicValues.push(dynamicValue);\n staticStrings.push(s);\n i++;\n }\n // If the last value isn't static (which would have consumed the last\n // string), then we need to add the last string.\n if (i === l) {\n staticStrings.push(strings[l]);\n }\n\n if (hasStatics) {\n const key = staticStrings.join('$$lit$$');\n strings = stringsCache.get(key)!;\n if (strings === undefined) {\n stringsCache.set(\n key,\n (strings = staticStrings as unknown as TemplateStringsArray)\n );\n }\n values = dynamicValues;\n }\n return coreTag(strings, ...values);\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const html = withStatic(coreHtml);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n *\n * Includes static value support from `lit-html/static.js`.\n */\nexport const svg = withStatic(coreSvg);\n"]}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { Part, DirectiveParent, TemplateResult } from './lit-html.js';
|
|
7
|
+
import { DirectiveResult, DirectiveClass, PartInfo } from './directive.js';
|
|
8
|
+
declare type Primitive = null | undefined | boolean | number | string | symbol | bigint;
|
|
9
9
|
/**
|
|
10
10
|
* Tests if a value is a primitive value.
|
|
11
11
|
*
|
|
12
12
|
* See https://tc39.github.io/ecma262/#sec-typeof-operator
|
|
13
13
|
*/
|
|
14
|
-
export declare const isPrimitive: (value: unknown) => value is
|
|
14
|
+
export declare const isPrimitive: (value: unknown) => value is Primitive;
|
|
15
15
|
export declare const TemplateResultType: {
|
|
16
16
|
readonly HTML: 1;
|
|
17
17
|
readonly SVG: 2;
|
|
@@ -20,7 +20,7 @@ export declare type TemplateResultType = typeof TemplateResultType[keyof typeof
|
|
|
20
20
|
/**
|
|
21
21
|
* Tests if a value is a TemplateResult.
|
|
22
22
|
*/
|
|
23
|
-
export declare const isTemplateResult: (value: unknown, type?:
|
|
23
|
+
export declare const isTemplateResult: (value: unknown, type?: TemplateResultType | undefined) => value is TemplateResult<1 | 2>;
|
|
24
24
|
/**
|
|
25
25
|
* Tests if a value is a DirectiveResult.
|
|
26
26
|
*/
|
|
@@ -102,4 +102,5 @@ export declare const getCommittedValue: (part: import("./lit-html.js").ChildPart
|
|
|
102
102
|
*/
|
|
103
103
|
export declare const removePart: (part: import("./lit-html.js").ChildPart) => void;
|
|
104
104
|
export declare const clearPart: (part: import("./lit-html.js").ChildPart) => void;
|
|
105
|
+
export {};
|
|
105
106
|
//# sourceMappingURL=directive-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive-helpers.d.ts","sourceRoot":"","sources":["../src/directive-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"directive-helpers.d.ts","sourceRoot":"","sources":["../src/directive-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAO,IAAI,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,cAAc,EACd,QAAQ,EAET,MAAM,gBAAgB,CAAC;AACxB,aAAK,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAehF;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,OAAO,uBACkC,CAAC;AAE7E,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,oBAAY,kBAAkB,GAC5B,OAAO,kBAAkB,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB,UACpB,OAAO,0EAMwC,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,6CAEe,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,cAAc,GAAG,SAEnB,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,SAAU,QAAQ,YACE,CAAC;AAIpD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wMAqDtB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,gEAErB,OAAO,oBACG,eAAe,MAIjC,CAAC;AAMF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,SAAU,IAAI,UAAS,OAAO,YAC3B,CAAC;AAElC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,sDAA6C,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,UAAU,mDAStB,CAAC;AAEF,eAAO,MAAM,SAAS,mDAErB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{_
|
|
1
|
+
import{_$LH as o}from"./lit-html.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2020 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/const{
|
|
6
|
+
*/const{H:i}=o,t=o=>null===o||"object"!=typeof o&&"function"!=typeof o,n={HTML:1,SVG:2},v=(o,i)=>{var t,n;return void 0===i?void 0!==(null===(t=o)||void 0===t?void 0:t._$litType$):(null===(n=o)||void 0===n?void 0:n._$litType$)===i},l=o=>{var i;return void 0!==(null===(i=o)||void 0===i?void 0:i._$litDirective$)},d=o=>{var i;return null===(i=o)||void 0===i?void 0:i._$litDirective$},r=o=>void 0===o.strings,e=()=>document.createComment(""),u=(o,t,n)=>{var v;const l=o._$AA.parentNode,d=void 0===t?o._$AB:t._$AA;if(void 0===n){const t=l.insertBefore(e(),d),v=l.insertBefore(e(),d);n=new i(t,v,o,o.options)}else{const i=n._$AB.nextSibling,t=n._$AM,r=t!==o;if(r){let i;null===(v=n._$AQ)||void 0===v||v.call(n,o),n._$AM=o,void 0!==n._$AP&&(i=o._$AU)!==t._$AU&&n._$AP(i)}if(i!==d||r){let o=n._$AA;for(;o!==i;){const i=o.nextSibling;l.insertBefore(o,d),o=i}}}return n},c=(o,i,t=o)=>(o._$AI(i,t),o),f={},s=(o,i=f)=>o._$AH=i,a=o=>o._$AH,m=o=>{var i;null===(i=o._$AP)||void 0===i||i.call(o,!1,!0);let t=o._$AA;const n=o._$AB.nextSibling;for(;t!==n;){const o=t.nextSibling;t.remove(),t=o}},p=o=>{o._$AR()};export{n as TemplateResultType,p as clearPart,a as getCommittedValue,d as getDirectiveClass,u as insertPart,l as isDirectiveResult,t as isPrimitive,r as isSingleExpression,v as isTemplateResult,m as removePart,c as setChildPartValue,s as setCommittedValue};
|
|
7
7
|
//# sourceMappingURL=directive-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive-helpers.js","sources":["src/directive-helpers.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {_
|
|
1
|
+
{"version":3,"file":"directive-helpers.js","sources":["src/directive-helpers.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {_$LH, Part, DirectiveParent, TemplateResult} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n} as const;\n\nexport type TemplateResultType =\n typeof TemplateResultType[keyof typeof TemplateResultType];\n\n/**\n * Tests if a value is a TemplateResult.\n */\nexport const isTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is TemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as TemplateResult)?.['_$litType$'] !== undefined\n : (value as TemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinal value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being commited.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$notifyConnectionChanged?.(false, true);\n let start: ChildNode | null = part._$startNode;\n const end: ChildNode | null = wrap(part._$endNode!).nextSibling;\n while (start !== end) {\n const n: ChildNode | null = wrap(start!).nextSibling;\n (wrap(start!) as ChildNode).remove();\n start = n;\n }\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n"],"names":["_ChildPart","ChildPart","_$LH","isPrimitive","value","TemplateResultType","HTML","SVG","isTemplateResult","type","undefined","isDirectiveResult","getDirectiveClass","isSingleExpression","part","strings","createMarker","document","createComment","insertPart","containerPart","refPart","container","_$startNode","parentNode","refNode","_$endNode","startNode","insertBefore","endNode","options","nextSibling","oldParent","_$parent","parentChanged","newConnectionState","_$reparentDisconnectables","_$notifyConnectionChanged","_$isConnected","start","n","setChildPartValue","directiveParent","_$setValue","RESET_VALUE","setCommittedValue","_$committedValue","getCommittedValue","removePart","end","remove","clearPart","_$clear"],"mappings":";;;;;GAeA,MAAOA,EAAYC,GAAaC,EAkBnBC,EAAeC,GAChB,OAAVA,GAAmC,iBAATA,GAAqC,mBAATA,EAE3CC,EAAqB,CAChCC,KAAM,EACNC,IAAK,GASMC,EAAmB,CAC9BJ,EACAK,aAEA,YAASC,IAATD,OAEkDC,eAA7CN,wBAAuC,uBACvCA,wBAAuC,cAAMK,GAKvCE,EAAqBP,UAEhC,YAAoDM,eAAnDN,wBAA6C,kBAKnCQ,EAAqBR,UAEhC,iBAACA,wBAA6C,iBAUnCS,EAAsBC,QACOJ,IAAvCI,EAA2BC,QAExBC,EAAe,IAAMC,SAASC,cAAc,IAcrCC,EAAa,CACxBC,EACAC,EACAP,WAEA,MAAMQ,EAAiBF,EAAcG,KAAaC,WAE5CC,OACQf,IAAZW,EAAwBD,EAAcM,KAAYL,EAAQE,KAE5D,QAAab,IAATI,EAAoB,CACtB,MAAMa,EAAiBL,EAAWM,aAAaZ,IAAgBS,GACzDI,EAAeP,EAAWM,aAAaZ,IAAgBS,GAC7DX,EAAO,IAAIb,EACT0B,EACAE,EACAT,EACAA,EAAcU,aAEX,CACL,MAAMD,EAAef,EAAKY,KAAYK,YAChCC,EAAYlB,EAAKmB,KACjBC,EAAgBF,IAAcZ,EACpC,GAAIc,EAAe,CAUjB,IAAIC,YATJrB,EAAKsB,0BAALtB,EAAiCM,GAKjCN,EAAKmB,KAAWb,OAMqBV,IAAnCI,EAAKuB,OACJF,EAAqBf,EAAckB,QAClCN,EAAWM,MAEbxB,EAAKuB,KAA0BF,GAGnC,GAAIN,IAAYJ,GAAWS,EAAe,CACxC,IAAIK,EAAqBzB,EAAKS,KAC9B,KAAOgB,IAAUV,GAAS,CACxB,MAAMW,EAAsBD,EAAQR,YAC/BT,EAAWM,aAAaW,EAAQd,GACrCc,EAAQC,IAKd,OAAO1B,GAmBI2B,EAAoB,CAC/B3B,EACAV,EACAsC,EAAmC5B,KAEnCA,EAAK6B,KAAWvC,EAAOsC,GAChB5B,GAKH8B,EAAc,GAaPC,EAAoB,CAAC/B,EAAYV,EAAiBwC,IAC5D9B,EAAKgC,KAAmB1C,EAgBd2C,EAAqBjC,GAAoBA,EAAKgC,KAO9CE,EAAclC,oBACzBA,EAAKuB,0BAALvB,GAAiC,GAAO,GACxC,IAAIyB,EAA0BzB,EAAKS,KACnC,MAAM0B,EAA6BnC,EAAKY,KAAYK,YACpD,KAAOQ,IAAUU,GAAK,CACpB,MAAMT,EAA2BD,EAAQR,YACnCQ,EAAsBW,SAC5BX,EAAQC,IAICW,EAAarC,IACxBA,EAAKsC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
6
|
import { Disconnectable, Part } from './lit-html';
|
|
7
|
-
export { AttributePart, BooleanAttributePart, ChildPart, ElementPart, EventPart, Part, } from './lit-html';
|
|
7
|
+
export { AttributePart, BooleanAttributePart, ChildPart, ElementPart, EventPart, Part, PropertyPart, } from './lit-html';
|
|
8
8
|
export interface DirectiveClass {
|
|
9
9
|
new (part: PartInfo): Directive;
|
|
10
10
|
}
|
|
@@ -18,10 +18,6 @@ export declare type DirectiveParameters<C extends Directive> = Parameters<C['ren
|
|
|
18
18
|
* returns a DirectiveResult object that captures the arguments.
|
|
19
19
|
*/
|
|
20
20
|
export interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {
|
|
21
|
-
/** @internal */
|
|
22
|
-
_$litDirective$: C;
|
|
23
|
-
/** @internal */
|
|
24
|
-
values: DirectiveParameters<InstanceType<C>>;
|
|
25
21
|
}
|
|
26
22
|
export declare const PartType: {
|
|
27
23
|
readonly ATTRIBUTE: 1;
|
|
@@ -61,18 +57,9 @@ export declare const directive: <C extends DirectiveClass>(c: C) => (...values:
|
|
|
61
57
|
* implement `render` and/or `update`, and then pass their subclass to
|
|
62
58
|
* `directive`.
|
|
63
59
|
*/
|
|
64
|
-
export declare abstract class Directive {
|
|
65
|
-
__part: Part;
|
|
66
|
-
__attributeIndex: number | undefined;
|
|
67
|
-
__directive?: Directive;
|
|
68
|
-
_$parent: Disconnectable;
|
|
69
|
-
_$disconnetableChildren?: Set<Disconnectable>;
|
|
70
|
-
_$setDirectiveConnected?(isConnected: boolean): void;
|
|
60
|
+
export declare abstract class Directive implements Disconnectable {
|
|
71
61
|
constructor(_partInfo: PartInfo);
|
|
72
|
-
|
|
73
|
-
_$initialize(part: Part, parent: Disconnectable, attributeIndex: number | undefined): void;
|
|
74
|
-
/** @internal */
|
|
75
|
-
_$resolve(part: Part, props: Array<unknown>): unknown;
|
|
62
|
+
get _$isConnected(): boolean;
|
|
76
63
|
abstract render(...props: Array<unknown>): unknown;
|
|
77
64
|
update(_part: Part, props: Array<unknown>): unknown;
|
|
78
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../src/directive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,cAAc,EAAE,IAAI,EAAC,MAAM,YAAY,CAAC;AAEhD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,SAAS,EACT,IAAI,
|
|
1
|
+
{"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../src/directive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,cAAc,EAAE,IAAI,EAAC,MAAM,YAAY,CAAC;AAEhD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,SAAS,EACT,IAAI,EACJ,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,KAAK,IAAI,EAAE,QAAQ,G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AE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,OAAO;CAGpD"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},
|
|
6
|
+
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}export{i as Directive,t as PartType,e as directive};
|
|
7
7
|
//# sourceMappingURL=directive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive.js","sources":["src/directive.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n} from './lit-html';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n
|
|
1
|
+
{"version":3,"file":"directive.js","sources":["src/directive.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = typeof PartType[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n"],"names":["PartType","ATTRIBUTE","CHILD","PROPERTY","BOOLEAN_ATTRIBUTE","EVENT","ELEMENT","directive","c","values","_$litDirective$","Directive","constructor","_partInfo","_$isConnected","this","_$parent","_$initialize","part","parent","attributeIndex","__part","__attributeIndex","_$resolve","props","update","_part","render"],"mappings":";;;;;MAyCaA,EAAW,CACtBC,UAAW,EACXC,MAAO,EACPC,SAAU,EACVC,kBAAmB,EACnBC,MAAO,EACPC,QAAS,GAoCEC,EACgBC,GAC3B,IAAIC,MAEFC,gBAAqBF,EACrBC,OAAAA,UAQkBE,EAkBpBC,YAAYC,IAGRC,WACF,OAAOC,KAAKC,KAASF,KAIvBG,KACEC,EACAC,EACAC,GAEAL,KAAKM,KAASH,EACdH,KAAKC,KAAWG,EAChBJ,KAAKO,KAAmBF,EAG1BG,KAAUL,EAAYM,GACpB,OAAOT,KAAKU,OAAOP,EAAMM,GAK3BC,OAAOC,EAAaF,GAClB,OAAOT,KAAKY,UAAUH"}
|
|
@@ -3,21 +3,14 @@
|
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { ChildPart } from '../lit-html.js';
|
|
7
7
|
import { DirectiveParameters, PartInfo } from '../directive.js';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare class AsyncAppendDirective extends AsyncDirective {
|
|
12
|
-
private _value?;
|
|
13
|
-
private _reconnectResolver?;
|
|
14
|
-
private _reconnectPromise?;
|
|
8
|
+
import { AsyncReplaceDirective } from './async-replace.js';
|
|
9
|
+
declare class AsyncAppendDirective extends AsyncReplaceDirective {
|
|
10
|
+
private __childPart;
|
|
15
11
|
constructor(partInfo: PartInfo);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private __iterate;
|
|
19
|
-
disconnected(): void;
|
|
20
|
-
reconnected(): void;
|
|
12
|
+
update(part: ChildPart, params: DirectiveParameters<this>): typeof import("../lit-html.js").noChange | undefined;
|
|
13
|
+
protected commitValue(value: unknown, index: number): void;
|
|
21
14
|
}
|
|
22
15
|
/**
|
|
23
16
|
* A directive that renders the items of an async iterable[1], appending new
|
|
@@ -37,7 +30,7 @@ declare class AsyncAppendDirective extends AsyncDirective {
|
|
|
37
30
|
* @param mapper An optional function that maps from (value, index) to another
|
|
38
31
|
* value. Useful for generating templates for each item in the iterable.
|
|
39
32
|
*/
|
|
40
|
-
export declare const asyncAppend: (value: AsyncIterable<unknown>, _mapper?:
|
|
33
|
+
export declare const asyncAppend: (value: AsyncIterable<unknown>, _mapper?: ((v: unknown, index?: number | undefined) => unknown) | undefined) => import("../directive.js").DirectiveResult<typeof AsyncAppendDirective>;
|
|
41
34
|
/**
|
|
42
35
|
* The type of the class that powers this directive. Necessary for naming the
|
|
43
36
|
* directive's return type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-append.d.ts","sourceRoot":"","sources":["../../src/directives/async-append.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"async-append.d.ts","sourceRoot":"","sources":["../../src/directives/async-append.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAEL,mBAAmB,EACnB,QAAQ,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAOzD,cAAM,oBAAqB,SAAQ,qBAAqB;IACtD,OAAO,CAAC,WAAW,CAAa;gBAGpB,QAAQ,EAAE,QAAQ;IAQrB,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC;cAM/C,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;CAU7D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,wLAAkC,CAAC;AAE3D;;;GAGG;AACH,YAAY,EAAC,oBAAoB,EAAC,CAAC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import{
|
|
2
|
-
import{clearPart as s,insertPart as r,setChildPartValue as o}from"../directive-helpers.js";
|
|
3
|
-
import{directive as e,PartType as i}from"../directive.js";
|
|
4
|
-
import{noChange as t}from"../lit-html.js";
|
|
5
|
-
|
|
1
|
+
import{directive as r,PartType as e}from"../directive.js";import{AsyncReplaceDirective as s}from"./async-replace.js";import{clearPart as t,insertPart as o,setChildPartValue as i}from"../directive-helpers.js";
|
|
6
2
|
/**
|
|
7
3
|
* @license
|
|
8
4
|
* Copyright 2017 Google LLC
|
|
9
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
10
|
-
*/const c=
|
|
6
|
+
*/const c=r(class extends s{constructor(r){if(super(r),r.type!==e.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$CX=r,super.update(r,e)}commitValue(r,e){0===e&&t(this._$CX);const s=o(this._$CX);i(s,r)}});export{c as asyncAppend};
|
|
11
7
|
//# sourceMappingURL=async-append.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-append.js","sources":["../src/directives/async-append.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ChildPart
|
|
1
|
+
{"version":3,"file":"async-append.js","sources":["../src/directives/async-append.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {ChildPart} from '../lit-html.js';\nimport {\n directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\nimport {AsyncReplaceDirective} from './async-replace.js';\nimport {\n clearPart,\n insertPart,\n setChildPartValue,\n} from '../directive-helpers.js';\n\nclass AsyncAppendDirective extends AsyncReplaceDirective {\n private __childPart!: ChildPart;\n\n // Override AsyncReplace to narrow the allowed part type to ChildPart only\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.CHILD) {\n throw new Error('asyncAppend can only be used in child expressions');\n }\n }\n\n // Override AsyncReplace to save the part since we need to append into it\n override update(part: ChildPart, params: DirectiveParameters<this>) {\n this.__childPart = part;\n return super.update(part, params);\n }\n\n // Override AsyncReplace to append rather than replace\n protected override commitValue(value: unknown, index: number) {\n // When we get the first value, clear the part. This lets the\n // previous value display until we can replace it.\n if (index === 0) {\n clearPart(this.__childPart);\n }\n // Create and insert a new part and set its value to the next value\n const newPart = insertPart(this.__childPart);\n setChildPartValue(newPart, value);\n }\n}\n\n/**\n * A directive that renders the items of an async iterable[1], appending new\n * values after previous values, similar to the built-in support for iterables.\n * This directive is usable only in child expressions.\n *\n * Async iterables are objects with a [Symbol.asyncIterator] method, which\n * returns an iterator who's `next()` method returns a Promise. When a new\n * value is available, the Promise resolves and the value is appended to the\n * Part controlled by the directive. If another value other than this\n * directive has been set on the Part, the iterable will no longer be listened\n * to and new values won't be written to the Part.\n *\n * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\n *\n * @param value An async iterable\n * @param mapper An optional function that maps from (value, index) to another\n * value. Useful for generating templates for each item in the iterable.\n */\nexport const asyncAppend = directive(AsyncAppendDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {AsyncAppendDirective};\n"],"names":["asyncAppend","directive","AsyncReplaceDirective","constructor","partInfo","super","type","PartType","CHILD","Error","update","part","params","this","__childPart","commitValue","value","index","clearPart","newPart","insertPart","setChildPartValue"],"mappings":";;;;;SAoEaA,EAAcC,EAhD3B,cAAmCC,EAIjCC,YAAYC,GAEV,GADAC,MAAMD,GACFA,EAASE,OAASC,EAASC,MAC7B,MAAUC,MAAM,qDAKXC,OAAOC,EAAiBC,GAE/B,OADAC,KAAKC,KAAcH,EACZN,MAAMK,OAAOC,EAAMC,GAITG,YAAYC,EAAgBC,GAG/B,IAAVA,GACFC,EAAUL,KAAKC,MAGjB,MAAMK,EAAUC,EAAWP,KAAKC,MAChCO,EAAkBF,EAASH"}
|