@stencil/core 4.43.5 → 5.0.0-alpha.10
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/bin/stencil.mjs +2 -0
- package/dist/app-data/index.d.ts +2 -0
- package/dist/app-data/index.js +104 -0
- package/dist/app-globals/index.d.ts +5 -0
- package/dist/app-globals/index.js +5 -0
- package/dist/chunk-z9aeyW2b.mjs +15 -0
- package/dist/client-aTQ7xHxx.mjs +4678 -0
- package/dist/compiler/index.d.mts +192 -0
- package/dist/compiler/index.mjs +3 -0
- package/dist/compiler/utils/index.d.mts +2 -0
- package/dist/compiler/utils/index.mjs +3 -0
- package/dist/compiler-lTINDSgw.mjs +23136 -0
- package/{internal → dist/declarations}/stencil-ext-modules.d.ts +8 -8
- package/dist/declarations/stencil-public-compiler.d.ts +4374 -0
- package/dist/declarations/stencil-public-compiler.js +51 -0
- package/dist/declarations/stencil-public-docs.d.ts +505 -0
- package/dist/declarations/stencil-public-runtime.d.ts +1982 -0
- package/dist/declarations/stencil-public-runtime.js +0 -0
- package/dist/index-BvkyxSY6.d.mts +205 -0
- package/dist/index-vY35H18z.d.mts +6525 -0
- package/dist/index-xAkMgLX_.d.ts +1942 -0
- package/{internal/stencil-core/index.d.ts → dist/index.d.mts} +11 -4
- package/dist/index.mjs +2 -0
- package/dist/jsx-runtime.d.mts +18 -0
- package/dist/jsx-runtime.mjs +2 -0
- package/dist/mock-doc.d.mts +1 -0
- package/dist/mock-doc.mjs +2 -0
- package/dist/node--akYC-sG.mjs +1937 -0
- package/dist/regular-expression-CFVJOTUh.mjs +508 -0
- package/dist/runtime/client/lazy.js +4930 -0
- package/dist/runtime/client/runtime.d.ts +2386 -0
- package/dist/runtime/client/runtime.js +4924 -0
- package/dist/runtime/index.d.ts +211 -0
- package/dist/runtime/index.js +4795 -0
- package/dist/runtime/server/index.d.mts +1179 -0
- package/dist/runtime/server/index.mjs +5140 -0
- package/dist/runtime/server/runner.d.mts +319 -0
- package/dist/runtime/server/runner.mjs +13642 -0
- package/dist/signals/index.d.ts +47 -0
- package/dist/signals/index.js +199 -0
- package/dist/sys/node/index.d.mts +32 -0
- package/dist/sys/node/index.mjs +2 -0
- package/dist/sys/node/worker.d.mts +1 -0
- package/dist/sys/node/worker.mjs +48 -0
- package/dist/testing/index.d.mts +303 -0
- package/dist/testing/index.mjs +1477 -0
- package/dist/validation-ByxKj8bC.mjs +1458 -0
- package/package.json +108 -228
- package/bin/stencil +0 -57
- package/cli/config-flags.d.ts +0 -132
- package/cli/index.cjs +0 -6041
- package/cli/index.d.ts +0 -19
- package/cli/index.js +0 -6034
- package/cli/package.json +0 -14
- package/compiler/lib.d.ts +0 -22
- package/compiler/lib.decorators.d.ts +0 -384
- package/compiler/lib.decorators.legacy.d.ts +0 -22
- package/compiler/lib.dom.asynciterable.d.ts +0 -41
- package/compiler/lib.dom.d.ts +0 -29610
- package/compiler/lib.dom.iterable.d.ts +0 -493
- package/compiler/lib.es2015.collection.d.ts +0 -147
- package/compiler/lib.es2015.core.d.ts +0 -597
- package/compiler/lib.es2015.d.ts +0 -28
- package/compiler/lib.es2015.generator.d.ts +0 -77
- package/compiler/lib.es2015.iterable.d.ts +0 -605
- package/compiler/lib.es2015.promise.d.ts +0 -81
- package/compiler/lib.es2015.proxy.d.ts +0 -128
- package/compiler/lib.es2015.reflect.d.ts +0 -144
- package/compiler/lib.es2015.symbol.d.ts +0 -46
- package/compiler/lib.es2015.symbol.wellknown.d.ts +0 -326
- package/compiler/lib.es2016.array.include.d.ts +0 -116
- package/compiler/lib.es2016.d.ts +0 -21
- package/compiler/lib.es2016.full.d.ts +0 -23
- package/compiler/lib.es2016.intl.d.ts +0 -31
- package/compiler/lib.es2017.arraybuffer.d.ts +0 -21
- package/compiler/lib.es2017.d.ts +0 -26
- package/compiler/lib.es2017.date.d.ts +0 -31
- package/compiler/lib.es2017.full.d.ts +0 -23
- package/compiler/lib.es2017.intl.d.ts +0 -44
- package/compiler/lib.es2017.object.d.ts +0 -49
- package/compiler/lib.es2017.sharedmemory.d.ts +0 -135
- package/compiler/lib.es2017.string.d.ts +0 -45
- package/compiler/lib.es2017.typedarrays.d.ts +0 -53
- package/compiler/lib.es2018.asyncgenerator.d.ts +0 -77
- package/compiler/lib.es2018.asynciterable.d.ts +0 -53
- package/compiler/lib.es2018.d.ts +0 -24
- package/compiler/lib.es2018.full.d.ts +0 -24
- package/compiler/lib.es2018.intl.d.ts +0 -83
- package/compiler/lib.es2018.promise.d.ts +0 -30
- package/compiler/lib.es2018.regexp.d.ts +0 -37
- package/compiler/lib.es2019.array.d.ts +0 -79
- package/compiler/lib.es2019.d.ts +0 -24
- package/compiler/lib.es2019.full.d.ts +0 -24
- package/compiler/lib.es2019.intl.d.ts +0 -23
- package/compiler/lib.es2019.object.d.ts +0 -33
- package/compiler/lib.es2019.string.d.ts +0 -37
- package/compiler/lib.es2019.symbol.d.ts +0 -24
- package/compiler/lib.es2020.bigint.d.ts +0 -765
- package/compiler/lib.es2020.d.ts +0 -27
- package/compiler/lib.es2020.date.d.ts +0 -42
- package/compiler/lib.es2020.full.d.ts +0 -24
- package/compiler/lib.es2020.intl.d.ts +0 -474
- package/compiler/lib.es2020.number.d.ts +0 -28
- package/compiler/lib.es2020.promise.d.ts +0 -47
- package/compiler/lib.es2020.sharedmemory.d.ts +0 -99
- package/compiler/lib.es2020.string.d.ts +0 -44
- package/compiler/lib.es2020.symbol.wellknown.d.ts +0 -41
- package/compiler/lib.es2021.d.ts +0 -23
- package/compiler/lib.es2021.full.d.ts +0 -24
- package/compiler/lib.es2021.intl.d.ts +0 -166
- package/compiler/lib.es2021.promise.d.ts +0 -48
- package/compiler/lib.es2021.string.d.ts +0 -33
- package/compiler/lib.es2021.weakref.d.ts +0 -78
- package/compiler/lib.es2022.array.d.ts +0 -121
- package/compiler/lib.es2022.d.ts +0 -25
- package/compiler/lib.es2022.error.d.ts +0 -75
- package/compiler/lib.es2022.full.d.ts +0 -24
- package/compiler/lib.es2022.intl.d.ts +0 -121
- package/compiler/lib.es2022.object.d.ts +0 -26
- package/compiler/lib.es2022.regexp.d.ts +0 -39
- package/compiler/lib.es2022.string.d.ts +0 -25
- package/compiler/lib.es2023.array.d.ts +0 -924
- package/compiler/lib.es2023.collection.d.ts +0 -21
- package/compiler/lib.es2023.d.ts +0 -22
- package/compiler/lib.es2023.full.d.ts +0 -24
- package/compiler/lib.es2023.intl.d.ts +0 -56
- package/compiler/lib.es2024.arraybuffer.d.ts +0 -65
- package/compiler/lib.es2024.collection.d.ts +0 -29
- package/compiler/lib.es2024.d.ts +0 -26
- package/compiler/lib.es2024.full.d.ts +0 -24
- package/compiler/lib.es2024.object.d.ts +0 -29
- package/compiler/lib.es2024.promise.d.ts +0 -35
- package/compiler/lib.es2024.regexp.d.ts +0 -25
- package/compiler/lib.es2024.sharedmemory.d.ts +0 -68
- package/compiler/lib.es2024.string.d.ts +0 -29
- package/compiler/lib.es5.d.ts +0 -4594
- package/compiler/lib.es6.d.ts +0 -23
- package/compiler/lib.esnext.array.d.ts +0 -35
- package/compiler/lib.esnext.collection.d.ts +0 -96
- package/compiler/lib.esnext.d.ts +0 -27
- package/compiler/lib.esnext.decorators.d.ts +0 -28
- package/compiler/lib.esnext.disposable.d.ts +0 -193
- package/compiler/lib.esnext.float16.d.ts +0 -443
- package/compiler/lib.esnext.full.d.ts +0 -24
- package/compiler/lib.esnext.intl.d.ts +0 -21
- package/compiler/lib.esnext.iterator.d.ts +0 -148
- package/compiler/lib.esnext.promise.d.ts +0 -34
- package/compiler/lib.scripthost.d.ts +0 -322
- package/compiler/lib.webworker.asynciterable.d.ts +0 -41
- package/compiler/lib.webworker.d.ts +0 -9894
- package/compiler/lib.webworker.importscripts.d.ts +0 -23
- package/compiler/lib.webworker.iterable.d.ts +0 -287
- package/compiler/package.json +0 -8
- package/compiler/stencil.d.ts +0 -73
- package/compiler/stencil.js +0 -288221
- package/compiler/sys/in-memory-fs.d.ts +0 -227
- package/compiler/transpile.d.ts +0 -32
- package/dev-server/client/app-error.d.ts +0 -20
- package/dev-server/client/events.d.ts +0 -6
- package/dev-server/client/hmr-components.d.ts +0 -12
- package/dev-server/client/hmr-external-styles.d.ts +0 -1
- package/dev-server/client/hmr-images.d.ts +0 -1
- package/dev-server/client/hmr-inline-styles.d.ts +0 -1
- package/dev-server/client/hmr-util.d.ts +0 -39
- package/dev-server/client/hmr-window.d.ts +0 -10
- package/dev-server/client/index.d.ts +0 -6
- package/dev-server/client/index.js +0 -793
- package/dev-server/client/logger.d.ts +0 -6
- package/dev-server/client/package.json +0 -8
- package/dev-server/client/progress.d.ts +0 -3
- package/dev-server/client/status.d.ts +0 -4
- package/dev-server/client/test/hmr-util.spec.d.ts +0 -1
- package/dev-server/client/test/status.spec.d.ts +0 -1
- package/dev-server/connector.html +0 -6
- package/dev-server/index.d.ts +0 -3
- package/dev-server/index.js +0 -247
- package/dev-server/package.json +0 -8
- package/dev-server/server-process.js +0 -12304
- package/dev-server/server-worker-thread.js +0 -39
- package/dev-server/static/favicon.ico +0 -0
- package/dev-server/templates/directory-index.html +0 -176
- package/dev-server/templates/initial-load.html +0 -168
- package/dev-server/visualstudio.vbs +0 -82
- package/dev-server/xdg-open +0 -1066
- package/internal/app-data/index.cjs +0 -119
- package/internal/app-data/index.d.ts +0 -26
- package/internal/app-data/index.js +0 -92
- package/internal/app-data/package.json +0 -15
- package/internal/app-globals/index.d.ts +0 -2
- package/internal/app-globals/index.js +0 -14
- package/internal/app-globals/package.json +0 -14
- package/internal/child_process.d.ts +0 -7
- package/internal/client/index.js +0 -4777
- package/internal/client/package.json +0 -10
- package/internal/client/patch-browser.js +0 -45
- package/internal/client/polyfills/core-js.js +0 -11
- package/internal/client/polyfills/dom.js +0 -79
- package/internal/client/polyfills/es5-html-element.js +0 -1
- package/internal/client/polyfills/index.js +0 -34
- package/internal/client/polyfills/system.js +0 -6
- package/internal/client/shadow-css.js +0 -414
- package/internal/hydrate/index.js +0 -6915
- package/internal/hydrate/package.json +0 -7
- package/internal/hydrate/runner.d.ts +0 -287
- package/internal/hydrate/runner.js +0 -18173
- package/internal/index.d.ts +0 -4
- package/internal/index.js +0 -2
- package/internal/package.json +0 -9
- package/internal/stencil-core/index.cjs +0 -1
- package/internal/stencil-core/index.js +0 -18
- package/internal/stencil-core/jsx-dev-runtime.cjs +0 -7
- package/internal/stencil-core/jsx-dev-runtime.d.ts +0 -41
- package/internal/stencil-core/jsx-dev-runtime.js +0 -2
- package/internal/stencil-core/jsx-runtime.cjs +0 -8
- package/internal/stencil-core/jsx-runtime.d.ts +0 -40
- package/internal/stencil-core/jsx-runtime.js +0 -2
- package/internal/stencil-private.d.ts +0 -2549
- package/internal/stencil-public-compiler.d.ts +0 -2922
- package/internal/stencil-public-docs.d.ts +0 -472
- package/internal/stencil-public-runtime.d.ts +0 -1861
- package/internal/testing/index.js +0 -6779
- package/internal/testing/jsx-dev-runtime.d.ts +0 -2
- package/internal/testing/jsx-dev-runtime.js +0 -8
- package/internal/testing/jsx-runtime.d.ts +0 -2
- package/internal/testing/jsx-runtime.js +0 -9
- package/internal/testing/package.json +0 -7
- package/internal/utils/index.d.ts +0 -1
- package/internal/utils/result.d.ts +0 -112
- package/mock-doc/index.cjs +0 -10163
- package/mock-doc/index.d.ts +0 -1172
- package/mock-doc/index.js +0 -10142
- package/mock-doc/package.json +0 -15
- package/readme.md +0 -94
- package/screenshot/compare/assets/favicon.ico +0 -0
- package/screenshot/compare/assets/logo.png +0 -0
- package/screenshot/compare/build/app.css +0 -1
- package/screenshot/compare/build/app.esm.js +0 -1
- package/screenshot/compare/build/app.js +0 -33
- package/screenshot/compare/build/p-081b0641.js +0 -1
- package/screenshot/compare/build/p-227a1e18.entry.js +0 -1
- package/screenshot/compare/build/p-2c298727.entry.js +0 -1
- package/screenshot/compare/build/p-5479268c.entry.js +0 -1
- package/screenshot/compare/build/p-573ec8a4.entry.js +0 -1
- package/screenshot/compare/build/p-6ba08604.entry.js +0 -1
- package/screenshot/compare/build/p-6bc63295.entry.js +0 -1
- package/screenshot/compare/build/p-7a3759fd.entry.js +0 -1
- package/screenshot/compare/build/p-7b4e3ba7.js +0 -1
- package/screenshot/compare/build/p-988eb362.css +0 -1
- package/screenshot/compare/build/p-9b6a9315.js +0 -1
- package/screenshot/compare/build/p-b4cc611c.entry.js +0 -1
- package/screenshot/compare/build/p-d1bf53f5.entry.js +0 -1
- package/screenshot/compare/build/p-e2efe0df.js +0 -1
- package/screenshot/compare/build/p-e8ca6d97.entry.js +0 -1
- package/screenshot/compare/build/p-ec2f13e0.entry.js +0 -1
- package/screenshot/compare/build/p-f0b99977.entry.js +0 -1
- package/screenshot/compare/build/p-f4745c2f.entry.js +0 -1
- package/screenshot/compare/build/p-fbbae598.js +0 -1
- package/screenshot/compare/host.config.json +0 -15
- package/screenshot/compare/index.html +0 -1
- package/screenshot/compare/manifest.json +0 -13
- package/screenshot/connector-base.d.ts +0 -42
- package/screenshot/connector-local.d.ts +0 -7
- package/screenshot/connector.js +0 -2
- package/screenshot/index.d.ts +0 -3
- package/screenshot/index.js +0 -2642
- package/screenshot/local-connector.js +0 -2
- package/screenshot/package.json +0 -15
- package/screenshot/pixel-match.d.ts +0 -1
- package/screenshot/pixel-match.js +0 -2315
- package/screenshot/screenshot-compare.d.ts +0 -20
- package/screenshot/screenshot-fs.d.ts +0 -14
- package/sys/node/460.node-fetch.js +0 -451
- package/sys/node/autoprefixer.js +0 -9
- package/sys/node/glob.js +0 -1
- package/sys/node/graceful-fs.js +0 -1
- package/sys/node/index.d.ts +0 -39
- package/sys/node/index.js +0 -62
- package/sys/node/node-fetch.js +0 -12
- package/sys/node/package.json +0 -8
- package/sys/node/prompts.js +0 -1
- package/sys/node/worker.js +0 -4
- package/testing/index.d.ts +0 -9
- package/testing/index.js +0 -13276
- package/testing/jest/jest-27-and-under/jest-config.d.ts +0 -16
- package/testing/jest/jest-27-and-under/jest-environment.d.ts +0 -2
- package/testing/jest/jest-27-and-under/jest-facade.d.ts +0 -155
- package/testing/jest/jest-27-and-under/jest-preprocessor.d.ts +0 -59
- package/testing/jest/jest-27-and-under/jest-preset.d.ts +0 -3
- package/testing/jest/jest-27-and-under/jest-runner.d.ts +0 -11
- package/testing/jest/jest-27-and-under/jest-screenshot.d.ts +0 -2
- package/testing/jest/jest-27-and-under/jest-serializer.d.ts +0 -4
- package/testing/jest/jest-27-and-under/jest-setup-test-framework.d.ts +0 -9
- package/testing/jest/jest-27-and-under/matchers/attributes.d.ts +0 -14
- package/testing/jest/jest-27-and-under/matchers/class-list.d.ts +0 -12
- package/testing/jest/jest-27-and-under/matchers/events.d.ts +0 -25
- package/testing/jest/jest-27-and-under/matchers/html.d.ts +0 -13
- package/testing/jest/jest-27-and-under/matchers/index.d.ts +0 -24
- package/testing/jest/jest-27-and-under/matchers/screenshot.d.ts +0 -5
- package/testing/jest/jest-27-and-under/matchers/text.d.ts +0 -4
- package/testing/jest/jest-27-and-under/test/jest-config.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-preprocessor.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-runner.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-serializer.spec.d.ts +0 -1
- package/testing/jest/jest-27-and-under/test/jest-setup-test-framework.spec.d.ts +0 -1
- package/testing/jest/jest-28/jest-config.d.ts +0 -16
- package/testing/jest/jest-28/jest-environment.d.ts +0 -2
- package/testing/jest/jest-28/jest-facade.d.ts +0 -134
- package/testing/jest/jest-28/jest-preprocessor.d.ts +0 -35
- package/testing/jest/jest-28/jest-preset.d.ts +0 -3
- package/testing/jest/jest-28/jest-runner.d.ts +0 -11
- package/testing/jest/jest-28/jest-screenshot.d.ts +0 -2
- package/testing/jest/jest-28/jest-serializer.d.ts +0 -4
- package/testing/jest/jest-28/jest-setup-test-framework.d.ts +0 -9
- package/testing/jest/jest-28/matchers/attributes.d.ts +0 -14
- package/testing/jest/jest-28/matchers/class-list.d.ts +0 -12
- package/testing/jest/jest-28/matchers/events.d.ts +0 -25
- package/testing/jest/jest-28/matchers/html.d.ts +0 -13
- package/testing/jest/jest-28/matchers/index.d.ts +0 -24
- package/testing/jest/jest-28/matchers/screenshot.d.ts +0 -5
- package/testing/jest/jest-28/matchers/text.d.ts +0 -4
- package/testing/jest/jest-28/test/jest-config.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-preprocessor.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-runner.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-serializer.spec.d.ts +0 -1
- package/testing/jest/jest-28/test/jest-setup-test-framework.spec.d.ts +0 -1
- package/testing/jest/jest-29/jest-config.d.ts +0 -16
- package/testing/jest/jest-29/jest-environment.d.ts +0 -2
- package/testing/jest/jest-29/jest-facade.d.ts +0 -136
- package/testing/jest/jest-29/jest-preprocessor.d.ts +0 -35
- package/testing/jest/jest-29/jest-preset.d.ts +0 -3
- package/testing/jest/jest-29/jest-runner.d.ts +0 -11
- package/testing/jest/jest-29/jest-screenshot.d.ts +0 -2
- package/testing/jest/jest-29/jest-serializer.d.ts +0 -4
- package/testing/jest/jest-29/jest-setup-test-framework.d.ts +0 -9
- package/testing/jest/jest-29/matchers/attributes.d.ts +0 -14
- package/testing/jest/jest-29/matchers/class-list.d.ts +0 -12
- package/testing/jest/jest-29/matchers/events.d.ts +0 -25
- package/testing/jest/jest-29/matchers/html.d.ts +0 -13
- package/testing/jest/jest-29/matchers/index.d.ts +0 -24
- package/testing/jest/jest-29/matchers/screenshot.d.ts +0 -5
- package/testing/jest/jest-29/matchers/text.d.ts +0 -4
- package/testing/jest/jest-29/test/jest-config.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-preprocessor.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-runner.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-serializer.spec.d.ts +0 -1
- package/testing/jest/jest-29/test/jest-setup-test-framework.spec.d.ts +0 -1
- package/testing/jest/jest-apis.d.ts +0 -86
- package/testing/jest/jest-facade.d.ts +0 -74
- package/testing/jest/jest-stencil-connector.d.ts +0 -65
- package/testing/jest/test/jest-stencil-connector.spec.d.ts +0 -1
- package/testing/jest-environment.js +0 -3
- package/testing/jest-preprocessor.js +0 -3
- package/testing/jest-preset.js +0 -2
- package/testing/jest-runner.js +0 -3
- package/testing/jest-setuptestframework.js +0 -3
- package/testing/mock-fetch.d.ts +0 -11
- package/testing/mocks.d.ts +0 -56
- package/testing/package.json +0 -8
- package/testing/puppeteer/index.d.ts +0 -2
- package/testing/puppeteer/puppeteer-browser.d.ts +0 -6
- package/testing/puppeteer/puppeteer-declarations.d.ts +0 -414
- package/testing/puppeteer/puppeteer-element.d.ts +0 -67
- package/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
- package/testing/puppeteer/puppeteer-events.d.ts +0 -21
- package/testing/puppeteer/puppeteer-page.d.ts +0 -2
- package/testing/puppeteer/puppeteer-screenshot.d.ts +0 -27
- package/testing/puppeteer/test/puppeteer-screenshot.spec.d.ts +0 -1
- package/testing/reset-build-conditionals.d.ts +0 -12
- package/testing/spec-page.d.ts +0 -7
- package/testing/test/testing-utils.spec.d.ts +0 -1
- package/testing/test-transpile.d.ts +0 -2
- package/testing/testing-logger.d.ts +0 -26
- package/testing/testing-sys.d.ts +0 -6
- package/testing/testing-utils.d.ts +0 -80
- package/testing/testing.d.ts +0 -2
- /package/{screenshot/compare/build/index.esm.js → dist/declarations/stencil-public-docs.js} +0 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
const MEMBER_FLAGS = {
|
|
2
|
+
String: 1,
|
|
3
|
+
Number: 2,
|
|
4
|
+
Boolean: 4,
|
|
5
|
+
Any: 8,
|
|
6
|
+
Unknown: 16,
|
|
7
|
+
State: 32,
|
|
8
|
+
Method: 64,
|
|
9
|
+
Event: 128,
|
|
10
|
+
Element: 256,
|
|
11
|
+
ReflectAttr: 512,
|
|
12
|
+
Mutable: 1024,
|
|
13
|
+
Getter: 2048,
|
|
14
|
+
Setter: 4096,
|
|
15
|
+
Prop: 31,
|
|
16
|
+
HasAttribute: 31,
|
|
17
|
+
PropLike: 63
|
|
18
|
+
};
|
|
19
|
+
const WATCH_FLAGS = { Immediate: 1 };
|
|
20
|
+
const EVENT_FLAGS = {
|
|
21
|
+
Cancellable: 1,
|
|
22
|
+
Composed: 2,
|
|
23
|
+
Bubbles: 4
|
|
24
|
+
};
|
|
25
|
+
const LISTENER_FLAGS = {
|
|
26
|
+
Passive: 1,
|
|
27
|
+
Capture: 2,
|
|
28
|
+
TargetDocument: 4,
|
|
29
|
+
TargetWindow: 8,
|
|
30
|
+
TargetBody: 16
|
|
31
|
+
};
|
|
32
|
+
const HOST_FLAGS = {
|
|
33
|
+
hasConnected: 1,
|
|
34
|
+
hasRendered: 2,
|
|
35
|
+
isWaitingForChildren: 4,
|
|
36
|
+
isConstructingInstance: 8,
|
|
37
|
+
isQueuedForUpdate: 16,
|
|
38
|
+
hasInitializedComponent: 32,
|
|
39
|
+
hasLoadedComponent: 64,
|
|
40
|
+
isWatchReady: 128,
|
|
41
|
+
isListenReady: 256,
|
|
42
|
+
needsRerender: 512,
|
|
43
|
+
devOnRender: 1024,
|
|
44
|
+
devOnDidLoad: 2048
|
|
45
|
+
};
|
|
46
|
+
const CF_scopedCssEncapsulation = 2;
|
|
47
|
+
/**
|
|
48
|
+
* A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
|
|
49
|
+
*
|
|
50
|
+
* These flags should only be used in conjunction with {@link ComponentRuntimeMeta#$flags$}.
|
|
51
|
+
* They should _not_ be used for calculations against other fields/numbers
|
|
52
|
+
*/
|
|
53
|
+
const CMP_FLAGS = {
|
|
54
|
+
/**
|
|
55
|
+
* Used to determine if a component is using the shadow DOM.
|
|
56
|
+
* e.g. `shadow: true | {}` is set on the `@Component()` decorator
|
|
57
|
+
*/
|
|
58
|
+
shadowDomEncapsulation: 1,
|
|
59
|
+
/**
|
|
60
|
+
* Used to determine if a component is using scoped stylesheets
|
|
61
|
+
* e.g. `scoped: true` is set on the `@Component()` decorator
|
|
62
|
+
*/
|
|
63
|
+
scopedCssEncapsulation: CF_scopedCssEncapsulation,
|
|
64
|
+
/**
|
|
65
|
+
* Used to determine if a component does not use the shadow DOM _and_ has `<slot/>` tags in its markup.
|
|
66
|
+
*/
|
|
67
|
+
hasSlotRelocation: 4,
|
|
68
|
+
/**
|
|
69
|
+
* Determines if `delegatesFocus` is enabled for a component that uses the shadow DOM.
|
|
70
|
+
* e.g. `shadow: { delegatesFocus: true }` is set on the `@Component()` decorator
|
|
71
|
+
*/
|
|
72
|
+
shadowDelegatesFocus: 16,
|
|
73
|
+
/**
|
|
74
|
+
* Determines if `mode` is set on the `@Component()` decorator
|
|
75
|
+
*/
|
|
76
|
+
hasMode: 32,
|
|
77
|
+
/**
|
|
78
|
+
* Determines if styles must be scoped - i.e. the component uses scoped stylesheets.
|
|
79
|
+
*/
|
|
80
|
+
needsScopedEncapsulation: CF_scopedCssEncapsulation,
|
|
81
|
+
/**
|
|
82
|
+
* Determines if a component is form-associated or not. This is set based on
|
|
83
|
+
* options passed to the `@Component` decorator.
|
|
84
|
+
*/
|
|
85
|
+
formAssociated: 64,
|
|
86
|
+
/**
|
|
87
|
+
* Determines if a `shadow: true` component needs
|
|
88
|
+
* to have its styles scoped during SSR as opposed to using DSD.
|
|
89
|
+
*/
|
|
90
|
+
shadowNeedsScopedCss: 128,
|
|
91
|
+
/**
|
|
92
|
+
* Determines if a component has a `<slot>` in its template.
|
|
93
|
+
*/
|
|
94
|
+
hasSlot: 256,
|
|
95
|
+
/**
|
|
96
|
+
* Determines if a component uses modern class property declarations.
|
|
97
|
+
*/
|
|
98
|
+
hasModernPropertyDecls: 512,
|
|
99
|
+
/**
|
|
100
|
+
* Determines if `slotAssignment` is set to `'manual'` for a component that uses the shadow DOM.
|
|
101
|
+
* e.g. `shadow: { slotAssignment: 'manual' }` is set on the `@Component()` decorator
|
|
102
|
+
*/
|
|
103
|
+
shadowSlotAssignmentManual: 1024,
|
|
104
|
+
/**
|
|
105
|
+
* Determines if the shadow DOM mode is 'closed'.
|
|
106
|
+
* e.g. `encapsulation: { type: 'shadow', mode: 'closed' }` is set on the `@Component()` decorator
|
|
107
|
+
*/
|
|
108
|
+
shadowModeClosed: 2048,
|
|
109
|
+
/**
|
|
110
|
+
* Determines if the component should patch child node accessors for slot handling.
|
|
111
|
+
* e.g. `encapsulation: { type: 'none', patches: ['children'] }`
|
|
112
|
+
*/
|
|
113
|
+
patchChildren: 4096,
|
|
114
|
+
/**
|
|
115
|
+
* Determines if the component should patch cloneNode() for slot handling.
|
|
116
|
+
* e.g. `encapsulation: { type: 'none', patches: ['clone'] }`
|
|
117
|
+
*/
|
|
118
|
+
patchClone: 8192,
|
|
119
|
+
/**
|
|
120
|
+
* Determines if the component should patch appendChild/insertBefore for slot handling.
|
|
121
|
+
* e.g. `encapsulation: { type: 'none', patches: ['insert'] }`
|
|
122
|
+
*/
|
|
123
|
+
patchInsert: 16384,
|
|
124
|
+
/**
|
|
125
|
+
* Determines if the component should apply all slot patches.
|
|
126
|
+
* e.g. `encapsulation: { type: 'none', patches: ['all'] }`
|
|
127
|
+
* Equivalent to the global `experimentalSlotFixes` config option.
|
|
128
|
+
*/
|
|
129
|
+
patchAll: 32768
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Default style mode id
|
|
133
|
+
*/
|
|
134
|
+
const DEFAULT_STYLE_MODE = "$";
|
|
135
|
+
/**
|
|
136
|
+
* Namespaces
|
|
137
|
+
*/
|
|
138
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
139
|
+
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
140
|
+
const XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
141
|
+
/**
|
|
142
|
+
* File names and value
|
|
143
|
+
*/
|
|
144
|
+
const COLLECTION_MANIFEST_FILE_NAME = "collection-manifest.json";
|
|
145
|
+
const COLLECTION_APP_DATA_FILE_NAME = "app-data.js";
|
|
146
|
+
/**
|
|
147
|
+
* Constant for the 'copy' output target
|
|
148
|
+
*/
|
|
149
|
+
const COPY = "copy";
|
|
150
|
+
/**
|
|
151
|
+
* Constant for the 'custom' output target
|
|
152
|
+
*/
|
|
153
|
+
const CUSTOM = "custom";
|
|
154
|
+
/**
|
|
155
|
+
* Constant for the 'loader-bundle' output target
|
|
156
|
+
* (formerly 'dist' in v4)
|
|
157
|
+
*/
|
|
158
|
+
const LOADER_BUNDLE = "loader-bundle";
|
|
159
|
+
/**
|
|
160
|
+
* Constant for the 'standalone' output target
|
|
161
|
+
* (formerly 'dist-custom-elements' in v4)
|
|
162
|
+
*/
|
|
163
|
+
const STANDALONE = "standalone";
|
|
164
|
+
/**
|
|
165
|
+
* Constant for the 'ssr' output target
|
|
166
|
+
* (formerly 'dist-hydrate-script' in v4)
|
|
167
|
+
*/
|
|
168
|
+
const SSR = "ssr";
|
|
169
|
+
/**
|
|
170
|
+
* Constant for the 'ssr-wasm' output target.
|
|
171
|
+
* Compiles the SSR script to a WASM binary via javy for use in any WASM-capable host
|
|
172
|
+
* (PHP, Java, Ruby, Go, etc.) without requiring a JavaScript runtime.
|
|
173
|
+
*/
|
|
174
|
+
const SSR_WASM = "ssr-wasm";
|
|
175
|
+
/**
|
|
176
|
+
* Constant for the 'collection' output target
|
|
177
|
+
* (formerly 'dist-collection' sub-output in v4)
|
|
178
|
+
*
|
|
179
|
+
* Contains transpiled source + metadata for downstream Stencil projects
|
|
180
|
+
* to re-compile/bundle.
|
|
181
|
+
*/
|
|
182
|
+
const COLLECTION = "collection";
|
|
183
|
+
/**
|
|
184
|
+
* Constant for the 'types' output target
|
|
185
|
+
* (formerly 'dist-types' sub-output in v4)
|
|
186
|
+
*/
|
|
187
|
+
const TYPES = "types";
|
|
188
|
+
/**
|
|
189
|
+
* Constant for the 'global-style' output target
|
|
190
|
+
* Outputs global styles to a unified location available to all distributions.
|
|
191
|
+
*/
|
|
192
|
+
const GLOBAL_STYLE = "global-style";
|
|
193
|
+
/**
|
|
194
|
+
* Constant for the 'assets' output target
|
|
195
|
+
* Copies component assetsDirs to a unified location available to all distributions.
|
|
196
|
+
*/
|
|
197
|
+
const ASSETS = "assets";
|
|
198
|
+
/**
|
|
199
|
+
* Internal constant for the 'dist-lazy' output target
|
|
200
|
+
* (used by loader-bundle and www)
|
|
201
|
+
*/
|
|
202
|
+
const DIST_LAZY = "dist-lazy";
|
|
203
|
+
/**
|
|
204
|
+
* Constant for the 'docs-custom' output target
|
|
205
|
+
*/
|
|
206
|
+
const DOCS_CUSTOM = "docs-custom";
|
|
207
|
+
/**
|
|
208
|
+
* Constant for the 'docs-json' output target
|
|
209
|
+
*/
|
|
210
|
+
const DOCS_JSON = "docs-json";
|
|
211
|
+
/**
|
|
212
|
+
* Constant for the 'docs-readme' output target
|
|
213
|
+
*/
|
|
214
|
+
const DOCS_README = "docs-readme";
|
|
215
|
+
/**
|
|
216
|
+
* Constant for the 'docs-vscode' output target
|
|
217
|
+
*/
|
|
218
|
+
const DOCS_VSCODE = "docs-vscode";
|
|
219
|
+
/**
|
|
220
|
+
* Constant for the 'docs-custom-elements-manifest' output target
|
|
221
|
+
*/
|
|
222
|
+
const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
|
|
223
|
+
/**
|
|
224
|
+
* Constant for the 'stats' output target
|
|
225
|
+
*/
|
|
226
|
+
const STATS = "stats";
|
|
227
|
+
/**
|
|
228
|
+
* Constant for the 'www' output target
|
|
229
|
+
*/
|
|
230
|
+
const WWW = "www";
|
|
231
|
+
/**
|
|
232
|
+
* Valid output targets to specify in a Stencil config.
|
|
233
|
+
*
|
|
234
|
+
* Note that some internal output targets (e.g. `DIST_LAZY`, `DIST_GLOBAL_STYLES`)
|
|
235
|
+
* are programmatically created by the compiler and are not user-configurable.
|
|
236
|
+
*
|
|
237
|
+
* In v5, `TYPES` and `COLLECTION` are auto-generated in production builds unless explicitly configured.
|
|
238
|
+
*/
|
|
239
|
+
const VALID_CONFIG_OUTPUT_TARGETS = [
|
|
240
|
+
"www",
|
|
241
|
+
LOADER_BUNDLE,
|
|
242
|
+
STANDALONE,
|
|
243
|
+
"ssr",
|
|
244
|
+
SSR_WASM,
|
|
245
|
+
COLLECTION,
|
|
246
|
+
TYPES,
|
|
247
|
+
GLOBAL_STYLE,
|
|
248
|
+
ASSETS,
|
|
249
|
+
"dist",
|
|
250
|
+
"dist-custom-elements",
|
|
251
|
+
"dist-hydrate-script",
|
|
252
|
+
"dist-collection",
|
|
253
|
+
"dist-types",
|
|
254
|
+
DOCS_JSON,
|
|
255
|
+
DOCS_README,
|
|
256
|
+
DOCS_VSCODE,
|
|
257
|
+
DOCS_CUSTOM,
|
|
258
|
+
DOCS_CUSTOM_ELEMENTS_MANIFEST,
|
|
259
|
+
COPY,
|
|
260
|
+
CUSTOM,
|
|
261
|
+
STATS
|
|
262
|
+
];
|
|
263
|
+
const GENERATED_DTS = "components.d.ts";
|
|
264
|
+
const STYLE_EXT = [
|
|
265
|
+
"css",
|
|
266
|
+
"scss",
|
|
267
|
+
"sass",
|
|
268
|
+
"pcss",
|
|
269
|
+
"styl",
|
|
270
|
+
"stylus",
|
|
271
|
+
"less"
|
|
272
|
+
];
|
|
273
|
+
/**
|
|
274
|
+
* DOM Node types
|
|
275
|
+
*
|
|
276
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
277
|
+
*
|
|
278
|
+
* Note: this is a duplicate of the `NODE_TYPES` enum in mock-doc, it's
|
|
279
|
+
* copied over here so that we do not need to introduce a dependency on the
|
|
280
|
+
* mock-doc bundle in the runtime. See
|
|
281
|
+
* https://github.com/stenciljs/core/pull/5705 for more details.
|
|
282
|
+
*/
|
|
283
|
+
const NODE_TYPES = {
|
|
284
|
+
ELEMENT_NODE: 1,
|
|
285
|
+
ATTRIBUTE_NODE: 2,
|
|
286
|
+
TEXT_NODE: 3,
|
|
287
|
+
CDATA_SECTION_NODE: 4,
|
|
288
|
+
ENTITY_REFERENCE_NODE: 5,
|
|
289
|
+
ENTITY_NODE: 6,
|
|
290
|
+
PROCESSING_INSTRUCTION_NODE: 7,
|
|
291
|
+
COMMENT_NODE: 8,
|
|
292
|
+
DOCUMENT_NODE: 9,
|
|
293
|
+
DOCUMENT_TYPE_NODE: 10,
|
|
294
|
+
DOCUMENT_FRAGMENT_NODE: 11,
|
|
295
|
+
NOTATION_NODE: 12
|
|
296
|
+
};
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region src/utils/query-nonce-meta-tag-content.ts
|
|
299
|
+
/**
|
|
300
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
301
|
+
* out of a DOM's head.
|
|
302
|
+
*
|
|
303
|
+
* @param doc The DOM containing the `head` to query against
|
|
304
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
305
|
+
* exists or the tag has no content.
|
|
306
|
+
*/
|
|
307
|
+
function queryNonceMetaTagContent(doc) {
|
|
308
|
+
return doc.head?.querySelector("meta[name=\"csp-nonce\"]")?.getAttribute("content") ?? void 0;
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/utils/helpers.ts
|
|
312
|
+
/**
|
|
313
|
+
* Check if a value is defined (not null and not undefined).
|
|
314
|
+
*
|
|
315
|
+
* @param v - the value to check
|
|
316
|
+
* @returns true if the value is defined
|
|
317
|
+
*/
|
|
318
|
+
const isDef = (v) => v != null && v !== void 0;
|
|
319
|
+
/**
|
|
320
|
+
* Convert a string from PascalCase to dash-case
|
|
321
|
+
*
|
|
322
|
+
* @param str the string to convert
|
|
323
|
+
* @returns a converted string
|
|
324
|
+
*/
|
|
325
|
+
const toDashCase = (str) => str.replace(/([A-Z0-9])/g, (match) => ` ${match[0]}`).trim().split(" ").join("-").toLowerCase();
|
|
326
|
+
/**
|
|
327
|
+
* Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
|
|
328
|
+
* or whatever you call it!)
|
|
329
|
+
*
|
|
330
|
+
* @param str a string to convert
|
|
331
|
+
* @returns a converted string
|
|
332
|
+
*/
|
|
333
|
+
const dashToPascalCase = (str) => str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("");
|
|
334
|
+
/**
|
|
335
|
+
* Convert a string to 'camelCase'
|
|
336
|
+
*
|
|
337
|
+
* @param str the string to convert
|
|
338
|
+
* @returns the converted string
|
|
339
|
+
*/
|
|
340
|
+
const toCamelCase = (str) => {
|
|
341
|
+
const pascalCase = dashToPascalCase(str);
|
|
342
|
+
return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* Capitalize the first letter of a string
|
|
346
|
+
*
|
|
347
|
+
* @param str the string to capitalize
|
|
348
|
+
* @returns a capitalized string
|
|
349
|
+
*/
|
|
350
|
+
const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
351
|
+
/**
|
|
352
|
+
* Escapes all occurrences of a specified pattern in a string.
|
|
353
|
+
* This function replaces all matches of a given pattern in the input text with a specified replacement string.
|
|
354
|
+
* It can handle both string and regular expression patterns and allows toggling between global and single-match replacements.
|
|
355
|
+
*
|
|
356
|
+
* @param text - The input string to process.
|
|
357
|
+
* @param pattern - The pattern to search for in the input string. Can be a regular expression or a string.
|
|
358
|
+
* @param replacement - The string to replace each match with.
|
|
359
|
+
* @param replaceAll - Whether to replace all occurrences (true) or just the first occurrence (false). Defaults to true.
|
|
360
|
+
* @returns The processed string with the replacements applied.
|
|
361
|
+
*/
|
|
362
|
+
const escapeWithPattern = (text, pattern, replacement, replaceAll = true) => {
|
|
363
|
+
let regex;
|
|
364
|
+
if (typeof pattern === "string") {
|
|
365
|
+
const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
366
|
+
regex = new RegExp(escaped, replaceAll ? "g" : "");
|
|
367
|
+
} else {
|
|
368
|
+
const flags = pattern.flags;
|
|
369
|
+
const hasG = flags.includes("g");
|
|
370
|
+
const newFlags = replaceAll ? hasG ? flags : flags + "g" : hasG ? flags.replace(/g/g, "") : flags;
|
|
371
|
+
regex = new RegExp(pattern.source, newFlags);
|
|
372
|
+
}
|
|
373
|
+
return text.replace(regex, replacement);
|
|
374
|
+
};
|
|
375
|
+
/**
|
|
376
|
+
* This is just a no-op, don't expect it to do anything.
|
|
377
|
+
*/
|
|
378
|
+
const noop = () => {};
|
|
379
|
+
/**
|
|
380
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
381
|
+
* function.
|
|
382
|
+
*
|
|
383
|
+
* @param o the value to check
|
|
384
|
+
* @returns whether it's a complex type or not
|
|
385
|
+
*/
|
|
386
|
+
const isComplexType = (o) => {
|
|
387
|
+
o = typeof o;
|
|
388
|
+
return o === "object" || o === "function";
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Sort an array without mutating it in-place (as `Array.prototype.sort`
|
|
392
|
+
* unfortunately does)
|
|
393
|
+
*
|
|
394
|
+
* @param array the array you'd like to sort
|
|
395
|
+
* @param prop a function for deriving sortable values (strings or numbers)
|
|
396
|
+
* from array members
|
|
397
|
+
* @returns a new array of all items `x` in `array` ordered by `prop(x)`
|
|
398
|
+
*/
|
|
399
|
+
const sortBy = (array, prop) => {
|
|
400
|
+
return array.slice().sort((a, b) => {
|
|
401
|
+
const nameA = prop(a);
|
|
402
|
+
const nameB = prop(b);
|
|
403
|
+
if (nameA < nameB) return -1;
|
|
404
|
+
if (nameA > nameB) return 1;
|
|
405
|
+
return 0;
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
/**
|
|
409
|
+
* A polyfill of sorts for `Array.prototype.flat` which will return the result
|
|
410
|
+
* of calling that method if present and, if not, return an equivalent based on
|
|
411
|
+
* `Array.prototype.reduce`.
|
|
412
|
+
*
|
|
413
|
+
* @param array the array to flatten (one level)
|
|
414
|
+
* @returns a flattened array
|
|
415
|
+
*/
|
|
416
|
+
const flatOne = (array) => {
|
|
417
|
+
if (array.flat) return array.flat(1);
|
|
418
|
+
return array.reduce((result, item) => {
|
|
419
|
+
result.push(...item);
|
|
420
|
+
return result;
|
|
421
|
+
}, []);
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* Deduplicate an array, retaining items at the earliest position in which
|
|
425
|
+
* they appear.
|
|
426
|
+
*
|
|
427
|
+
* So `unique([1,3,2,1,1,4])` would be `[1,3,2,4]`.
|
|
428
|
+
*
|
|
429
|
+
* @param array the array to deduplicate
|
|
430
|
+
* @param predicate an optional function used to generate the key used to
|
|
431
|
+
* determine uniqueness
|
|
432
|
+
* @returns a new, deduplicated array
|
|
433
|
+
*/
|
|
434
|
+
const unique = (array, predicate = (i) => i) => {
|
|
435
|
+
const set = /* @__PURE__ */ new Set();
|
|
436
|
+
return array.filter((item) => {
|
|
437
|
+
const key = predicate(item);
|
|
438
|
+
if (key == null) return true;
|
|
439
|
+
if (set.has(key)) return false;
|
|
440
|
+
set.add(key);
|
|
441
|
+
return true;
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* Merge elements of an array into an existing array, using a predicate to
|
|
446
|
+
* determine uniqueness and only adding elements when they are not present in
|
|
447
|
+
* the first array.
|
|
448
|
+
*
|
|
449
|
+
* **Note**: this mutates the target array! This is intentional to avoid
|
|
450
|
+
* unnecessary array allocation, but be sure that it's what you want!
|
|
451
|
+
*
|
|
452
|
+
* @param target the target array, to which new unique items should be added
|
|
453
|
+
* @param newItems a list of new items, some (or all!) of which may be added
|
|
454
|
+
* @param mergeWith a predicate function which reduces the items in `target`
|
|
455
|
+
* and `newItems` to a value which can be equated with `===` for the purposes
|
|
456
|
+
* of determining uniqueness
|
|
457
|
+
*/
|
|
458
|
+
function mergeIntoWith(target, newItems, mergeWith) {
|
|
459
|
+
for (const item of newItems) if (!target.find((existingItem) => mergeWith(existingItem) === mergeWith(item))) target.push(item);
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* A utility for building an object from an iterable very similar to
|
|
463
|
+
* `Object.fromEntries`
|
|
464
|
+
*
|
|
465
|
+
* @param entries an iterable object holding entries (key-value tuples) to
|
|
466
|
+
* plop into a new object
|
|
467
|
+
* @returns an object containing those entries
|
|
468
|
+
*/
|
|
469
|
+
const fromEntries = (entries) => {
|
|
470
|
+
const object = {};
|
|
471
|
+
for (const [key, value] of entries) object[key] = value;
|
|
472
|
+
return object;
|
|
473
|
+
};
|
|
474
|
+
/**
|
|
475
|
+
* Based on a given object, create a new object which has only the specified
|
|
476
|
+
* key-value pairs included in it.
|
|
477
|
+
*
|
|
478
|
+
* @param obj the object from which to take values
|
|
479
|
+
* @param keys a set of keys to take
|
|
480
|
+
* @returns an object mapping `key` to `obj[key]` if `obj[key]` is truthy for
|
|
481
|
+
* every `key` in `keys`
|
|
482
|
+
*/
|
|
483
|
+
const pluck = (obj, keys) => {
|
|
484
|
+
return keys.reduce((final, key) => {
|
|
485
|
+
if (obj[key]) final[key] = obj[key];
|
|
486
|
+
return final;
|
|
487
|
+
}, {});
|
|
488
|
+
};
|
|
489
|
+
const isDefined = (v) => v !== null && v !== void 0;
|
|
490
|
+
const isBoolean = (v) => typeof v === "boolean";
|
|
491
|
+
const isFunction = (v) => typeof v === "function";
|
|
492
|
+
const isNumber = (v) => typeof v === "number";
|
|
493
|
+
const isObject = (val) => val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
494
|
+
const isString = (v) => typeof v === "string";
|
|
495
|
+
const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/utils/regular-expression.ts
|
|
498
|
+
/**
|
|
499
|
+
* Utility function that will escape all regular expression special characters in a string.
|
|
500
|
+
*
|
|
501
|
+
* @param text The string potentially containing special characters.
|
|
502
|
+
* @returns The string with all special characters escaped.
|
|
503
|
+
*/
|
|
504
|
+
const escapeRegExpSpecialCharacters = (text) => {
|
|
505
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
506
|
+
};
|
|
507
|
+
//#endregion
|
|
508
|
+
export { VALID_CONFIG_OUTPUT_TARGETS as $, DEFAULT_STYLE_MODE as A, HOST_FLAGS as B, ASSETS as C, COLLECTION_MANIFEST_FILE_NAME as D, COLLECTION_APP_DATA_FILE_NAME as E, DOCS_README as F, NODE_TYPES as G, LISTENER_FLAGS as H, DOCS_VSCODE as I, STANDALONE as J, SSR as K, EVENT_FLAGS as L, DOCS_CUSTOM as M, DOCS_CUSTOM_ELEMENTS_MANIFEST as N, COPY as O, DOCS_JSON as P, TYPES as Q, GENERATED_DTS as R, queryNonceMetaTagContent as S, COLLECTION as T, LOADER_BUNDLE as U, HTML_NS as V, MEMBER_FLAGS as W, STYLE_EXT as X, STATS as Y, SVG_NS as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, WATCH_FLAGS as et, isObject as f, pluck as g, noop as h, flatOne as i, DIST_LAZY as j, CUSTOM as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, XLINK_NS as nt, isBoolean as o, isString as p, SSR_WASM as q, escapeWithPattern as r, isComplexType as s, escapeRegExpSpecialCharacters as t, WWW as tt, isIterable as u, toCamelCase as v, CMP_FLAGS as w, unique as x, toDashCase as y, GLOBAL_STYLE as z };
|