@builder.io/sdk-qwik 0.16.11 → 0.16.14
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/lib/browser/blocks/accordion/accordion.qwik.cjs +74 -143
- package/lib/browser/blocks/accordion/accordion.qwik.mjs +74 -143
- package/lib/browser/blocks/accordion/component-info.qwik.cjs +2 -1
- package/lib/browser/blocks/accordion/component-info.qwik.mjs +2 -1
- package/lib/browser/blocks/button/button.qwik.cjs +8 -17
- package/lib/browser/blocks/button/button.qwik.mjs +8 -17
- package/lib/browser/blocks/columns/columns.qwik.cjs +33 -67
- package/lib/browser/blocks/columns/columns.qwik.mjs +33 -67
- package/lib/browser/blocks/columns/component-info.qwik.cjs +4 -3
- package/lib/browser/blocks/columns/component-info.qwik.mjs +4 -3
- package/lib/browser/blocks/custom-code/custom-code.qwik.cjs +18 -22
- package/lib/browser/blocks/custom-code/custom-code.qwik.mjs +19 -23
- package/lib/browser/blocks/embed/embed.qwik.cjs +17 -23
- package/lib/browser/blocks/embed/embed.qwik.mjs +17 -23
- package/lib/browser/blocks/form/form/form.qwik.cjs +74 -128
- package/lib/browser/blocks/form/form/form.qwik.mjs +75 -129
- package/lib/browser/blocks/form/input/input.qwik.cjs +2 -2
- package/lib/browser/blocks/form/input/input.qwik.mjs +3 -3
- package/lib/browser/blocks/form/select/select.qwik.cjs +7 -5
- package/lib/browser/blocks/form/select/select.qwik.mjs +8 -6
- package/lib/browser/blocks/form/submit-button/submit-button.qwik.cjs +7 -9
- package/lib/browser/blocks/form/submit-button/submit-button.qwik.mjs +8 -10
- package/lib/browser/blocks/form/textarea/textarea.qwik.cjs +11 -21
- package/lib/browser/blocks/form/textarea/textarea.qwik.mjs +12 -22
- package/lib/browser/blocks/fragment/fragment.qwik.cjs +6 -3
- package/lib/browser/blocks/fragment/fragment.qwik.mjs +7 -4
- package/lib/browser/blocks/image/component-info.qwik.cjs +6 -3
- package/lib/browser/blocks/image/component-info.qwik.mjs +6 -3
- package/lib/browser/blocks/image/image.helpers.qwik.cjs +12 -6
- package/lib/browser/blocks/image/image.helpers.qwik.mjs +12 -6
- package/lib/browser/blocks/image/image.qwik.cjs +63 -89
- package/lib/browser/blocks/image/image.qwik.mjs +63 -89
- package/lib/browser/blocks/img/img.qwik.cjs +12 -18
- package/lib/browser/blocks/img/img.qwik.mjs +12 -18
- package/lib/browser/blocks/section/section.qwik.cjs +7 -6
- package/lib/browser/blocks/section/section.qwik.mjs +8 -7
- package/lib/browser/blocks/slot/slot.qwik.cjs +17 -43
- package/lib/browser/blocks/slot/slot.qwik.mjs +17 -43
- package/lib/browser/blocks/symbol/symbol.helpers.qwik.cjs +2 -1
- package/lib/browser/blocks/symbol/symbol.helpers.qwik.mjs +2 -1
- package/lib/browser/blocks/symbol/symbol.qwik.cjs +45 -137
- package/lib/browser/blocks/symbol/symbol.qwik.mjs +45 -137
- package/lib/browser/blocks/tabs/tabs.qwik.cjs +45 -99
- package/lib/browser/blocks/tabs/tabs.qwik.mjs +45 -99
- package/lib/browser/blocks/text/text.qwik.cjs +11 -15
- package/lib/browser/blocks/text/text.qwik.mjs +11 -15
- package/lib/browser/blocks/video/video.qwik.cjs +73 -87
- package/lib/browser/blocks/video/video.qwik.mjs +74 -88
- package/lib/browser/components/awaiter.qwik.cjs +13 -0
- package/lib/browser/components/awaiter.qwik.mjs +13 -0
- package/lib/browser/components/block/animator.qwik.cjs +22 -11
- package/lib/browser/components/block/animator.qwik.mjs +22 -11
- package/lib/browser/components/block/block.helpers.qwik.cjs +8 -4
- package/lib/browser/components/block/block.helpers.qwik.mjs +8 -4
- package/lib/browser/components/block/block.qwik.cjs +114 -320
- package/lib/browser/components/block/block.qwik.mjs +115 -321
- package/lib/browser/components/block/components/block-styles.qwik.cjs +22 -39
- package/lib/browser/components/block/components/block-styles.qwik.mjs +23 -40
- package/lib/browser/components/block/components/block-wrapper.qwik.cjs +12 -18
- package/lib/browser/components/block/components/block-wrapper.qwik.mjs +12 -18
- package/lib/browser/components/block/components/component-ref/component-ref.qwik.cjs +12 -29
- package/lib/browser/components/block/components/component-ref/component-ref.qwik.mjs +14 -31
- package/lib/browser/components/block/components/interactive-element.qwik.cjs +28 -28
- package/lib/browser/components/block/components/interactive-element.qwik.mjs +28 -28
- package/lib/browser/components/block/components/repeated-block.qwik.cjs +10 -31
- package/lib/browser/components/block/components/repeated-block.qwik.mjs +11 -32
- package/lib/browser/components/blocks/blocks-wrapper.qwik.cjs +24 -72
- package/lib/browser/components/blocks/blocks-wrapper.qwik.mjs +24 -72
- package/lib/browser/components/blocks/blocks.qwik.cjs +19 -78
- package/lib/browser/components/blocks/blocks.qwik.mjs +20 -79
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +89 -219
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +89 -219
- package/lib/browser/components/content/components/styles.helpers.qwik.cjs +12 -6
- package/lib/browser/components/content/components/styles.helpers.qwik.mjs +12 -6
- package/lib/browser/components/content/components/styles.qwik.cjs +8 -20
- package/lib/browser/components/content/components/styles.qwik.mjs +8 -20
- package/lib/browser/components/content/content.helpers.qwik.cjs +2 -1
- package/lib/browser/components/content/content.helpers.qwik.mjs +2 -1
- package/lib/browser/components/content/content.qwik.cjs +65 -189
- package/lib/browser/components/content/content.qwik.mjs +65 -189
- package/lib/browser/components/content-variants/content-variants.qwik.cjs +74 -313
- package/lib/browser/components/content-variants/content-variants.qwik.mjs +75 -314
- package/lib/browser/components/dynamic-renderer/dynamic-renderer.qwik.cjs +11 -12
- package/lib/browser/components/dynamic-renderer/dynamic-renderer.qwik.mjs +12 -13
- package/lib/browser/components/inlined-script.qwik.cjs +8 -13
- package/lib/browser/components/inlined-script.qwik.mjs +9 -14
- package/lib/browser/components/inlined-styles.qwik.cjs +8 -13
- package/lib/browser/components/inlined-styles.qwik.mjs +9 -14
- package/lib/browser/constants/device-sizes.qwik.cjs +2 -1
- package/lib/browser/constants/device-sizes.qwik.mjs +2 -1
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/browser/functions/evaluate/browser-runtime/browser.qwik.cjs +1 -28
- package/lib/browser/functions/evaluate/browser-runtime/browser.qwik.mjs +1 -28
- package/lib/browser/functions/evaluate/choose-eval.qwik.cjs +3 -1
- package/lib/browser/functions/evaluate/choose-eval.qwik.mjs +3 -1
- package/lib/browser/functions/evaluate/evaluate.qwik.cjs +6 -3
- package/lib/browser/functions/evaluate/evaluate.qwik.mjs +6 -3
- package/lib/browser/functions/evaluate/helpers.qwik.cjs +30 -0
- package/lib/browser/functions/evaluate/helpers.qwik.mjs +30 -0
- package/lib/browser/functions/evaluate/should-force-browser-runtime-in-node.qwik.cjs +4 -2
- package/lib/browser/functions/evaluate/should-force-browser-runtime-in-node.qwik.mjs +4 -2
- package/lib/browser/functions/get-block-actions-handler.qwik.cjs +9 -15
- package/lib/browser/functions/get-block-actions-handler.qwik.mjs +10 -16
- package/lib/browser/functions/get-block-actions.qwik.cjs +4 -2
- package/lib/browser/functions/get-block-actions.qwik.mjs +4 -2
- package/lib/browser/functions/get-builder-search-params/index.qwik.cjs +4 -2
- package/lib/browser/functions/get-builder-search-params/index.qwik.mjs +4 -2
- package/lib/browser/functions/get-content/generate-content-url.qwik.cjs +22 -11
- package/lib/browser/functions/get-content/generate-content-url.qwik.mjs +22 -11
- package/lib/browser/functions/get-content/index.qwik.cjs +4 -2
- package/lib/browser/functions/get-content/index.qwik.mjs +4 -2
- package/lib/browser/functions/get-global-this.qwik.cjs +8 -4
- package/lib/browser/functions/get-global-this.qwik.mjs +8 -4
- package/lib/browser/functions/get-processed-block.qwik.cjs +15 -8
- package/lib/browser/functions/get-processed-block.qwik.mjs +15 -8
- package/lib/browser/functions/is-from-trusted-host.qwik.cjs +2 -1
- package/lib/browser/functions/is-from-trusted-host.qwik.mjs +2 -1
- package/lib/browser/functions/is-previewing.qwik.cjs +2 -1
- package/lib/browser/functions/is-previewing.qwik.mjs +2 -1
- package/lib/browser/functions/register-component.qwik.cjs +2 -1
- package/lib/browser/functions/register-component.qwik.mjs +2 -1
- package/lib/browser/functions/register.qwik.cjs +6 -3
- package/lib/browser/functions/register.qwik.mjs +6 -3
- package/lib/browser/functions/set.qwik.cjs +2 -1
- package/lib/browser/functions/set.qwik.mjs +2 -1
- package/lib/browser/functions/track/helpers.qwik.cjs +2 -1
- package/lib/browser/functions/track/helpers.qwik.mjs +2 -1
- package/lib/browser/functions/track/index.qwik.cjs +8 -4
- package/lib/browser/functions/track/index.qwik.mjs +8 -4
- package/lib/browser/functions/track/interaction.qwik.cjs +6 -3
- package/lib/browser/functions/track/interaction.qwik.mjs +6 -3
- package/lib/browser/helpers/ab-tests.qwik.cjs +15 -8
- package/lib/browser/helpers/ab-tests.qwik.mjs +16 -9
- package/lib/browser/helpers/cookie.qwik.cjs +4 -2
- package/lib/browser/helpers/cookie.qwik.mjs +4 -2
- package/lib/browser/helpers/css.qwik.cjs +6 -4
- package/lib/browser/helpers/css.qwik.mjs +6 -4
- package/lib/browser/helpers/flatten.qwik.cjs +3 -2
- package/lib/browser/helpers/flatten.qwik.mjs +3 -2
- package/lib/browser/helpers/localStorage.qwik.cjs +4 -2
- package/lib/browser/helpers/localStorage.qwik.mjs +4 -2
- package/lib/browser/helpers/omit.qwik.cjs +2 -1
- package/lib/browser/helpers/omit.qwik.mjs +2 -1
- package/lib/browser/helpers/search/search.qwik.cjs +3 -2
- package/lib/browser/helpers/search/search.qwik.mjs +3 -2
- package/lib/browser/helpers/sessionId.qwik.cjs +4 -3
- package/lib/browser/helpers/sessionId.qwik.mjs +4 -3
- package/lib/browser/helpers/subscribe-to-editor.qwik.cjs +10 -5
- package/lib/browser/helpers/subscribe-to-editor.qwik.mjs +10 -5
- package/lib/browser/helpers/url.qwik.cjs +4 -2
- package/lib/browser/helpers/url.qwik.mjs +4 -2
- package/lib/browser/helpers/visitorId.qwik.cjs +4 -3
- package/lib/browser/helpers/visitorId.qwik.mjs +4 -3
- package/lib/browser/scripts/init-editing.qwik.cjs +25 -19
- package/lib/browser/scripts/init-editing.qwik.mjs +25 -19
- package/lib/edge/blocks/accordion/accordion.qwik.cjs +74 -143
- package/lib/edge/blocks/accordion/accordion.qwik.mjs +74 -143
- package/lib/edge/blocks/accordion/component-info.qwik.cjs +2 -1
- package/lib/edge/blocks/accordion/component-info.qwik.mjs +2 -1
- package/lib/edge/blocks/button/button.qwik.cjs +8 -17
- package/lib/edge/blocks/button/button.qwik.mjs +8 -17
- package/lib/edge/blocks/columns/columns.qwik.cjs +33 -67
- package/lib/edge/blocks/columns/columns.qwik.mjs +33 -67
- package/lib/edge/blocks/columns/component-info.qwik.cjs +4 -3
- package/lib/edge/blocks/columns/component-info.qwik.mjs +4 -3
- package/lib/edge/blocks/custom-code/custom-code.qwik.cjs +18 -22
- package/lib/edge/blocks/custom-code/custom-code.qwik.mjs +19 -23
- package/lib/edge/blocks/embed/embed.qwik.cjs +17 -23
- package/lib/edge/blocks/embed/embed.qwik.mjs +17 -23
- package/lib/edge/blocks/form/form/form.qwik.cjs +74 -128
- package/lib/edge/blocks/form/form/form.qwik.mjs +75 -129
- package/lib/edge/blocks/form/input/input.qwik.cjs +2 -2
- package/lib/edge/blocks/form/input/input.qwik.mjs +3 -3
- package/lib/edge/blocks/form/select/select.qwik.cjs +7 -5
- package/lib/edge/blocks/form/select/select.qwik.mjs +8 -6
- package/lib/edge/blocks/form/submit-button/submit-button.qwik.cjs +7 -9
- package/lib/edge/blocks/form/submit-button/submit-button.qwik.mjs +8 -10
- package/lib/edge/blocks/form/textarea/textarea.qwik.cjs +11 -21
- package/lib/edge/blocks/form/textarea/textarea.qwik.mjs +12 -22
- package/lib/edge/blocks/fragment/fragment.qwik.cjs +6 -3
- package/lib/edge/blocks/fragment/fragment.qwik.mjs +7 -4
- package/lib/edge/blocks/image/component-info.qwik.cjs +6 -3
- package/lib/edge/blocks/image/component-info.qwik.mjs +6 -3
- package/lib/edge/blocks/image/image.helpers.qwik.cjs +12 -6
- package/lib/edge/blocks/image/image.helpers.qwik.mjs +12 -6
- package/lib/edge/blocks/image/image.qwik.cjs +63 -89
- package/lib/edge/blocks/image/image.qwik.mjs +63 -89
- package/lib/edge/blocks/img/img.qwik.cjs +12 -18
- package/lib/edge/blocks/img/img.qwik.mjs +12 -18
- package/lib/edge/blocks/section/section.qwik.cjs +7 -6
- package/lib/edge/blocks/section/section.qwik.mjs +8 -7
- package/lib/edge/blocks/slot/slot.qwik.cjs +17 -43
- package/lib/edge/blocks/slot/slot.qwik.mjs +17 -43
- package/lib/edge/blocks/symbol/symbol.helpers.qwik.cjs +2 -1
- package/lib/edge/blocks/symbol/symbol.helpers.qwik.mjs +2 -1
- package/lib/edge/blocks/symbol/symbol.qwik.cjs +45 -137
- package/lib/edge/blocks/symbol/symbol.qwik.mjs +45 -137
- package/lib/edge/blocks/tabs/tabs.qwik.cjs +45 -99
- package/lib/edge/blocks/tabs/tabs.qwik.mjs +45 -99
- package/lib/edge/blocks/text/text.qwik.cjs +11 -15
- package/lib/edge/blocks/text/text.qwik.mjs +11 -15
- package/lib/edge/blocks/video/video.qwik.cjs +73 -87
- package/lib/edge/blocks/video/video.qwik.mjs +74 -88
- package/lib/edge/components/awaiter.qwik.cjs +13 -0
- package/lib/edge/components/awaiter.qwik.mjs +13 -0
- package/lib/edge/components/block/animator.qwik.cjs +22 -11
- package/lib/edge/components/block/animator.qwik.mjs +22 -11
- package/lib/edge/components/block/block.helpers.qwik.cjs +8 -4
- package/lib/edge/components/block/block.helpers.qwik.mjs +8 -4
- package/lib/edge/components/block/block.qwik.cjs +114 -320
- package/lib/edge/components/block/block.qwik.mjs +115 -321
- package/lib/edge/components/block/components/block-styles.qwik.cjs +22 -39
- package/lib/edge/components/block/components/block-styles.qwik.mjs +23 -40
- package/lib/edge/components/block/components/block-wrapper.qwik.cjs +12 -18
- package/lib/edge/components/block/components/block-wrapper.qwik.mjs +12 -18
- package/lib/edge/components/block/components/component-ref/component-ref.qwik.cjs +12 -29
- package/lib/edge/components/block/components/component-ref/component-ref.qwik.mjs +14 -31
- package/lib/edge/components/block/components/interactive-element.qwik.cjs +28 -28
- package/lib/edge/components/block/components/interactive-element.qwik.mjs +28 -28
- package/lib/edge/components/block/components/repeated-block.qwik.cjs +10 -31
- package/lib/edge/components/block/components/repeated-block.qwik.mjs +11 -32
- package/lib/edge/components/blocks/blocks-wrapper.qwik.cjs +24 -72
- package/lib/edge/components/blocks/blocks-wrapper.qwik.mjs +24 -72
- package/lib/edge/components/blocks/blocks.qwik.cjs +19 -78
- package/lib/edge/components/blocks/blocks.qwik.mjs +20 -79
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +89 -219
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +89 -219
- package/lib/edge/components/content/components/styles.helpers.qwik.cjs +12 -6
- package/lib/edge/components/content/components/styles.helpers.qwik.mjs +12 -6
- package/lib/edge/components/content/components/styles.qwik.cjs +8 -20
- package/lib/edge/components/content/components/styles.qwik.mjs +8 -20
- package/lib/edge/components/content/content.helpers.qwik.cjs +2 -1
- package/lib/edge/components/content/content.helpers.qwik.mjs +2 -1
- package/lib/edge/components/content/content.qwik.cjs +65 -189
- package/lib/edge/components/content/content.qwik.mjs +65 -189
- package/lib/edge/components/content-variants/content-variants.qwik.cjs +74 -313
- package/lib/edge/components/content-variants/content-variants.qwik.mjs +75 -314
- package/lib/edge/components/dynamic-renderer/dynamic-renderer.qwik.cjs +11 -12
- package/lib/edge/components/dynamic-renderer/dynamic-renderer.qwik.mjs +12 -13
- package/lib/edge/components/inlined-script.qwik.cjs +8 -13
- package/lib/edge/components/inlined-script.qwik.mjs +9 -14
- package/lib/edge/components/inlined-styles.qwik.cjs +8 -13
- package/lib/edge/components/inlined-styles.qwik.mjs +9 -14
- package/lib/edge/constants/device-sizes.qwik.cjs +2 -1
- package/lib/edge/constants/device-sizes.qwik.mjs +2 -1
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/functions/evaluate/browser-runtime/browser.qwik.cjs +1 -28
- package/lib/edge/functions/evaluate/browser-runtime/browser.qwik.mjs +1 -28
- package/lib/edge/functions/evaluate/choose-eval.qwik.cjs +3 -1
- package/lib/edge/functions/evaluate/choose-eval.qwik.mjs +3 -1
- package/lib/edge/functions/evaluate/edge-runtime/acorn-interpreter.qwik.cjs +6 -7
- package/lib/edge/functions/evaluate/edge-runtime/acorn-interpreter.qwik.mjs +6 -7
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.qwik.cjs +63 -27
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.qwik.mjs +64 -28
- package/lib/edge/functions/evaluate/evaluate.qwik.cjs +6 -3
- package/lib/edge/functions/evaluate/evaluate.qwik.mjs +6 -3
- package/lib/edge/functions/evaluate/helpers.qwik.cjs +30 -0
- package/lib/edge/functions/evaluate/helpers.qwik.mjs +30 -0
- package/lib/edge/functions/evaluate/should-force-browser-runtime-in-node.qwik.cjs +4 -2
- package/lib/edge/functions/evaluate/should-force-browser-runtime-in-node.qwik.mjs +4 -2
- package/lib/edge/functions/get-block-actions-handler.qwik.cjs +9 -15
- package/lib/edge/functions/get-block-actions-handler.qwik.mjs +10 -16
- package/lib/edge/functions/get-block-actions.qwik.cjs +4 -2
- package/lib/edge/functions/get-block-actions.qwik.mjs +4 -2
- package/lib/edge/functions/get-builder-search-params/index.qwik.cjs +4 -2
- package/lib/edge/functions/get-builder-search-params/index.qwik.mjs +4 -2
- package/lib/edge/functions/get-content/generate-content-url.qwik.cjs +22 -11
- package/lib/edge/functions/get-content/generate-content-url.qwik.mjs +22 -11
- package/lib/edge/functions/get-content/index.qwik.cjs +4 -2
- package/lib/edge/functions/get-content/index.qwik.mjs +4 -2
- package/lib/edge/functions/get-global-this.qwik.cjs +8 -4
- package/lib/edge/functions/get-global-this.qwik.mjs +8 -4
- package/lib/edge/functions/get-processed-block.qwik.cjs +15 -8
- package/lib/edge/functions/get-processed-block.qwik.mjs +15 -8
- package/lib/edge/functions/is-from-trusted-host.qwik.cjs +2 -1
- package/lib/edge/functions/is-from-trusted-host.qwik.mjs +2 -1
- package/lib/edge/functions/is-previewing.qwik.cjs +2 -1
- package/lib/edge/functions/is-previewing.qwik.mjs +2 -1
- package/lib/edge/functions/register-component.qwik.cjs +2 -1
- package/lib/edge/functions/register-component.qwik.mjs +2 -1
- package/lib/edge/functions/register.qwik.cjs +6 -3
- package/lib/edge/functions/register.qwik.mjs +6 -3
- package/lib/edge/functions/set.qwik.cjs +2 -1
- package/lib/edge/functions/set.qwik.mjs +2 -1
- package/lib/edge/functions/track/helpers.qwik.cjs +2 -1
- package/lib/edge/functions/track/helpers.qwik.mjs +2 -1
- package/lib/edge/functions/track/index.qwik.cjs +8 -4
- package/lib/edge/functions/track/index.qwik.mjs +8 -4
- package/lib/edge/functions/track/interaction.qwik.cjs +6 -3
- package/lib/edge/functions/track/interaction.qwik.mjs +6 -3
- package/lib/edge/helpers/ab-tests.qwik.cjs +15 -8
- package/lib/edge/helpers/ab-tests.qwik.mjs +16 -9
- package/lib/edge/helpers/cookie.qwik.cjs +4 -2
- package/lib/edge/helpers/cookie.qwik.mjs +4 -2
- package/lib/edge/helpers/css.qwik.cjs +6 -4
- package/lib/edge/helpers/css.qwik.mjs +6 -4
- package/lib/edge/helpers/flatten.qwik.cjs +3 -2
- package/lib/edge/helpers/flatten.qwik.mjs +3 -2
- package/lib/edge/helpers/localStorage.qwik.cjs +4 -2
- package/lib/edge/helpers/localStorage.qwik.mjs +4 -2
- package/lib/edge/helpers/omit.qwik.cjs +2 -1
- package/lib/edge/helpers/omit.qwik.mjs +2 -1
- package/lib/edge/helpers/search/search.qwik.cjs +3 -2
- package/lib/edge/helpers/search/search.qwik.mjs +3 -2
- package/lib/edge/helpers/sessionId.qwik.cjs +4 -3
- package/lib/edge/helpers/sessionId.qwik.mjs +4 -3
- package/lib/edge/helpers/subscribe-to-editor.qwik.cjs +10 -5
- package/lib/edge/helpers/subscribe-to-editor.qwik.mjs +10 -5
- package/lib/edge/helpers/url.qwik.cjs +4 -2
- package/lib/edge/helpers/url.qwik.mjs +4 -2
- package/lib/edge/helpers/visitorId.qwik.cjs +4 -3
- package/lib/edge/helpers/visitorId.qwik.mjs +4 -3
- package/lib/edge/scripts/init-editing.qwik.cjs +25 -19
- package/lib/edge/scripts/init-editing.qwik.mjs +25 -19
- package/lib/node/blocks/accordion/accordion.qwik.cjs +74 -143
- package/lib/node/blocks/accordion/accordion.qwik.mjs +74 -143
- package/lib/node/blocks/accordion/component-info.qwik.cjs +2 -1
- package/lib/node/blocks/accordion/component-info.qwik.mjs +2 -1
- package/lib/node/blocks/button/button.qwik.cjs +8 -17
- package/lib/node/blocks/button/button.qwik.mjs +8 -17
- package/lib/node/blocks/columns/columns.qwik.cjs +33 -67
- package/lib/node/blocks/columns/columns.qwik.mjs +33 -67
- package/lib/node/blocks/columns/component-info.qwik.cjs +4 -3
- package/lib/node/blocks/columns/component-info.qwik.mjs +4 -3
- package/lib/node/blocks/custom-code/custom-code.qwik.cjs +18 -22
- package/lib/node/blocks/custom-code/custom-code.qwik.mjs +19 -23
- package/lib/node/blocks/embed/embed.qwik.cjs +17 -23
- package/lib/node/blocks/embed/embed.qwik.mjs +17 -23
- package/lib/node/blocks/form/form/form.qwik.cjs +74 -128
- package/lib/node/blocks/form/form/form.qwik.mjs +75 -129
- package/lib/node/blocks/form/input/input.qwik.cjs +2 -2
- package/lib/node/blocks/form/input/input.qwik.mjs +3 -3
- package/lib/node/blocks/form/select/select.qwik.cjs +7 -5
- package/lib/node/blocks/form/select/select.qwik.mjs +8 -6
- package/lib/node/blocks/form/submit-button/submit-button.qwik.cjs +7 -9
- package/lib/node/blocks/form/submit-button/submit-button.qwik.mjs +8 -10
- package/lib/node/blocks/form/textarea/textarea.qwik.cjs +11 -21
- package/lib/node/blocks/form/textarea/textarea.qwik.mjs +12 -22
- package/lib/node/blocks/fragment/fragment.qwik.cjs +6 -3
- package/lib/node/blocks/fragment/fragment.qwik.mjs +7 -4
- package/lib/node/blocks/image/component-info.qwik.cjs +6 -3
- package/lib/node/blocks/image/component-info.qwik.mjs +6 -3
- package/lib/node/blocks/image/image.helpers.qwik.cjs +12 -6
- package/lib/node/blocks/image/image.helpers.qwik.mjs +12 -6
- package/lib/node/blocks/image/image.qwik.cjs +63 -89
- package/lib/node/blocks/image/image.qwik.mjs +63 -89
- package/lib/node/blocks/img/img.qwik.cjs +12 -18
- package/lib/node/blocks/img/img.qwik.mjs +12 -18
- package/lib/node/blocks/section/section.qwik.cjs +7 -6
- package/lib/node/blocks/section/section.qwik.mjs +8 -7
- package/lib/node/blocks/slot/slot.qwik.cjs +17 -43
- package/lib/node/blocks/slot/slot.qwik.mjs +17 -43
- package/lib/node/blocks/symbol/symbol.helpers.qwik.cjs +2 -1
- package/lib/node/blocks/symbol/symbol.helpers.qwik.mjs +2 -1
- package/lib/node/blocks/symbol/symbol.qwik.cjs +45 -137
- package/lib/node/blocks/symbol/symbol.qwik.mjs +45 -137
- package/lib/node/blocks/tabs/tabs.qwik.cjs +45 -99
- package/lib/node/blocks/tabs/tabs.qwik.mjs +45 -99
- package/lib/node/blocks/text/text.qwik.cjs +11 -15
- package/lib/node/blocks/text/text.qwik.mjs +11 -15
- package/lib/node/blocks/video/video.qwik.cjs +73 -87
- package/lib/node/blocks/video/video.qwik.mjs +74 -88
- package/lib/node/components/awaiter.qwik.cjs +13 -0
- package/lib/node/components/awaiter.qwik.mjs +13 -0
- package/lib/node/components/block/animator.qwik.cjs +22 -11
- package/lib/node/components/block/animator.qwik.mjs +22 -11
- package/lib/node/components/block/block.helpers.qwik.cjs +8 -4
- package/lib/node/components/block/block.helpers.qwik.mjs +8 -4
- package/lib/node/components/block/block.qwik.cjs +114 -320
- package/lib/node/components/block/block.qwik.mjs +115 -321
- package/lib/node/components/block/components/block-styles.qwik.cjs +22 -39
- package/lib/node/components/block/components/block-styles.qwik.mjs +23 -40
- package/lib/node/components/block/components/block-wrapper.qwik.cjs +12 -18
- package/lib/node/components/block/components/block-wrapper.qwik.mjs +12 -18
- package/lib/node/components/block/components/component-ref/component-ref.qwik.cjs +12 -29
- package/lib/node/components/block/components/component-ref/component-ref.qwik.mjs +14 -31
- package/lib/node/components/block/components/interactive-element.qwik.cjs +28 -28
- package/lib/node/components/block/components/interactive-element.qwik.mjs +28 -28
- package/lib/node/components/block/components/repeated-block.qwik.cjs +10 -31
- package/lib/node/components/block/components/repeated-block.qwik.mjs +11 -32
- package/lib/node/components/blocks/blocks-wrapper.qwik.cjs +24 -72
- package/lib/node/components/blocks/blocks-wrapper.qwik.mjs +24 -72
- package/lib/node/components/blocks/blocks.qwik.cjs +19 -78
- package/lib/node/components/blocks/blocks.qwik.mjs +20 -79
- package/lib/node/components/content/components/enable-editor.qwik.cjs +89 -219
- package/lib/node/components/content/components/enable-editor.qwik.mjs +89 -219
- package/lib/node/components/content/components/styles.helpers.qwik.cjs +12 -6
- package/lib/node/components/content/components/styles.helpers.qwik.mjs +12 -6
- package/lib/node/components/content/components/styles.qwik.cjs +8 -20
- package/lib/node/components/content/components/styles.qwik.mjs +8 -20
- package/lib/node/components/content/content.helpers.qwik.cjs +2 -1
- package/lib/node/components/content/content.helpers.qwik.mjs +2 -1
- package/lib/node/components/content/content.qwik.cjs +65 -189
- package/lib/node/components/content/content.qwik.mjs +65 -189
- package/lib/node/components/content-variants/content-variants.qwik.cjs +74 -313
- package/lib/node/components/content-variants/content-variants.qwik.mjs +75 -314
- package/lib/node/components/dynamic-renderer/dynamic-renderer.qwik.cjs +11 -12
- package/lib/node/components/dynamic-renderer/dynamic-renderer.qwik.mjs +12 -13
- package/lib/node/components/inlined-script.qwik.cjs +8 -13
- package/lib/node/components/inlined-script.qwik.mjs +9 -14
- package/lib/node/components/inlined-styles.qwik.cjs +8 -13
- package/lib/node/components/inlined-styles.qwik.mjs +9 -14
- package/lib/node/constants/device-sizes.qwik.cjs +2 -1
- package/lib/node/constants/device-sizes.qwik.mjs +2 -1
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/functions/evaluate/browser-runtime/browser.qwik.cjs +1 -28
- package/lib/node/functions/evaluate/browser-runtime/browser.qwik.mjs +1 -28
- package/lib/node/functions/evaluate/choose-eval.qwik.cjs +3 -1
- package/lib/node/functions/evaluate/choose-eval.qwik.mjs +3 -1
- package/lib/node/functions/evaluate/evaluate.qwik.cjs +6 -3
- package/lib/node/functions/evaluate/evaluate.qwik.mjs +6 -3
- package/lib/node/functions/evaluate/helpers.qwik.cjs +30 -0
- package/lib/node/functions/evaluate/helpers.qwik.mjs +30 -0
- package/lib/node/functions/evaluate/node-runtime/init.qwik.cjs +6 -0
- package/lib/node/functions/evaluate/node-runtime/init.qwik.mjs +6 -0
- package/lib/node/functions/evaluate/node-runtime/node-runtime.qwik.cjs +1 -1
- package/lib/node/functions/evaluate/node-runtime/node-runtime.qwik.mjs +1 -1
- package/lib/node/functions/evaluate/should-force-browser-runtime-in-node.qwik.cjs +4 -2
- package/lib/node/functions/evaluate/should-force-browser-runtime-in-node.qwik.mjs +4 -2
- package/lib/node/functions/get-block-actions-handler.qwik.cjs +9 -15
- package/lib/node/functions/get-block-actions-handler.qwik.mjs +10 -16
- package/lib/node/functions/get-block-actions.qwik.cjs +4 -2
- package/lib/node/functions/get-block-actions.qwik.mjs +4 -2
- package/lib/node/functions/get-builder-search-params/index.qwik.cjs +4 -2
- package/lib/node/functions/get-builder-search-params/index.qwik.mjs +4 -2
- package/lib/node/functions/get-content/generate-content-url.qwik.cjs +22 -11
- package/lib/node/functions/get-content/generate-content-url.qwik.mjs +22 -11
- package/lib/node/functions/get-content/index.qwik.cjs +4 -2
- package/lib/node/functions/get-content/index.qwik.mjs +4 -2
- package/lib/node/functions/get-global-this.qwik.cjs +8 -4
- package/lib/node/functions/get-global-this.qwik.mjs +8 -4
- package/lib/node/functions/get-processed-block.qwik.cjs +15 -8
- package/lib/node/functions/get-processed-block.qwik.mjs +15 -8
- package/lib/node/functions/is-from-trusted-host.qwik.cjs +2 -1
- package/lib/node/functions/is-from-trusted-host.qwik.mjs +2 -1
- package/lib/node/functions/is-previewing.qwik.cjs +2 -1
- package/lib/node/functions/is-previewing.qwik.mjs +2 -1
- package/lib/node/functions/register-component.qwik.cjs +2 -1
- package/lib/node/functions/register-component.qwik.mjs +2 -1
- package/lib/node/functions/register.qwik.cjs +6 -3
- package/lib/node/functions/register.qwik.mjs +6 -3
- package/lib/node/functions/set.qwik.cjs +2 -1
- package/lib/node/functions/set.qwik.mjs +2 -1
- package/lib/node/functions/track/helpers.qwik.cjs +2 -1
- package/lib/node/functions/track/helpers.qwik.mjs +2 -1
- package/lib/node/functions/track/index.qwik.cjs +8 -4
- package/lib/node/functions/track/index.qwik.mjs +8 -4
- package/lib/node/functions/track/interaction.qwik.cjs +6 -3
- package/lib/node/functions/track/interaction.qwik.mjs +6 -3
- package/lib/node/helpers/ab-tests.qwik.cjs +15 -8
- package/lib/node/helpers/ab-tests.qwik.mjs +16 -9
- package/lib/node/helpers/cookie.qwik.cjs +4 -2
- package/lib/node/helpers/cookie.qwik.mjs +4 -2
- package/lib/node/helpers/css.qwik.cjs +6 -4
- package/lib/node/helpers/css.qwik.mjs +6 -4
- package/lib/node/helpers/flatten.qwik.cjs +3 -2
- package/lib/node/helpers/flatten.qwik.mjs +3 -2
- package/lib/node/helpers/localStorage.qwik.cjs +4 -2
- package/lib/node/helpers/localStorage.qwik.mjs +4 -2
- package/lib/node/helpers/omit.qwik.cjs +2 -1
- package/lib/node/helpers/omit.qwik.mjs +2 -1
- package/lib/node/helpers/search/search.qwik.cjs +3 -2
- package/lib/node/helpers/search/search.qwik.mjs +3 -2
- package/lib/node/helpers/sessionId.qwik.cjs +4 -3
- package/lib/node/helpers/sessionId.qwik.mjs +4 -3
- package/lib/node/helpers/subscribe-to-editor.qwik.cjs +10 -5
- package/lib/node/helpers/subscribe-to-editor.qwik.mjs +10 -5
- package/lib/node/helpers/url.qwik.cjs +4 -2
- package/lib/node/helpers/url.qwik.mjs +4 -2
- package/lib/node/helpers/visitorId.qwik.cjs +4 -3
- package/lib/node/helpers/visitorId.qwik.mjs +4 -3
- package/lib/node/scripts/init-editing.qwik.cjs +25 -19
- package/lib/node/scripts/init-editing.qwik.mjs +25 -19
- package/package.json +2 -2
- package/types/src/components/awaiter.d.ts +13 -0
- package/types/src/components/content/components/enable-editor.d.ts +0 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/context/component-reference-types.d.ts +4 -0
- package/types/src/context/types.d.ts +2 -1
- package/types/src/functions/evaluate/browser-runtime/browser.d.ts +0 -6
- package/types/src/functions/evaluate/helpers.d.ts +5 -0
- package/types/src/functions/evaluate/should-force-browser-runtime-in-node.d.ts +3 -1
- package/lib/browser/constants/sdk-name.qwik.cjs +0 -15
- package/lib/browser/constants/sdk-name.qwik.mjs +0 -15
- package/lib/browser/functions/evaluate/node-runtime/init.qwik.cjs +0 -9
- package/lib/browser/functions/evaluate/node-runtime/init.qwik.mjs +0 -9
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.qwik.cjs +0 -47
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.qwik.mjs +0 -47
- package/lib/browser/functions/evaluate/node-runtime/safeDynamicRequire.qwik.cjs +0 -15
- package/lib/browser/functions/evaluate/node-runtime/safeDynamicRequire.qwik.mjs +0 -15
- package/lib/edge/constants/sdk-name.qwik.cjs +0 -15
- package/lib/edge/constants/sdk-name.qwik.mjs +0 -15
- package/lib/edge/functions/evaluate/node-runtime/init.qwik.cjs +0 -9
- package/lib/edge/functions/evaluate/node-runtime/init.qwik.mjs +0 -9
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.qwik.cjs +0 -47
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.qwik.mjs +0 -47
- package/lib/edge/functions/evaluate/node-runtime/safeDynamicRequire.qwik.cjs +0 -15
- package/lib/edge/functions/evaluate/node-runtime/safeDynamicRequire.qwik.mjs +0 -15
|
@@ -6,7 +6,7 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
6
6
|
builder,
|
|
7
7
|
context,
|
|
8
8
|
event,
|
|
9
|
-
state: flattenState({
|
|
9
|
+
state: helpers.flattenState({
|
|
10
10
|
rootState,
|
|
11
11
|
localState,
|
|
12
12
|
rootSetState
|
|
@@ -14,31 +14,4 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
14
14
|
});
|
|
15
15
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
16
16
|
};
|
|
17
|
-
function flattenState({ rootState, localState, rootSetState }) {
|
|
18
|
-
return new Proxy(rootState, {
|
|
19
|
-
get: (target, prop) => {
|
|
20
|
-
if (localState && prop in localState)
|
|
21
|
-
return localState[prop];
|
|
22
|
-
const val = target[prop];
|
|
23
|
-
if (typeof val === "object" && val !== null)
|
|
24
|
-
return flattenState({
|
|
25
|
-
rootState: val,
|
|
26
|
-
localState: void 0,
|
|
27
|
-
rootSetState: rootSetState ? (subState) => {
|
|
28
|
-
target[prop] = subState;
|
|
29
|
-
rootSetState(target);
|
|
30
|
-
} : void 0
|
|
31
|
-
});
|
|
32
|
-
return val;
|
|
33
|
-
},
|
|
34
|
-
set: (target, prop, value) => {
|
|
35
|
-
if (localState && prop in localState)
|
|
36
|
-
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
37
|
-
target[prop] = value;
|
|
38
|
-
rootSetState == null ? void 0 : rootSetState(target);
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
exports.flattenState = flattenState;
|
|
44
17
|
exports.runInBrowser = runInBrowser;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFunctionArguments } from "../helpers.qwik.mjs";
|
|
1
|
+
import { getFunctionArguments, flattenState } from "../helpers.qwik.mjs";
|
|
2
2
|
const runInBrowser = ({ code, builder, context, event, localState, rootSetState, rootState }) => {
|
|
3
3
|
const functionArgs = getFunctionArguments({
|
|
4
4
|
builder,
|
|
@@ -12,33 +12,6 @@ const runInBrowser = ({ code, builder, context, event, localState, rootSetState,
|
|
|
12
12
|
});
|
|
13
13
|
return new Function(...functionArgs.map(([name]) => name), code)(...functionArgs.map(([, value]) => value));
|
|
14
14
|
};
|
|
15
|
-
function flattenState({ rootState, localState, rootSetState }) {
|
|
16
|
-
return new Proxy(rootState, {
|
|
17
|
-
get: (target, prop) => {
|
|
18
|
-
if (localState && prop in localState)
|
|
19
|
-
return localState[prop];
|
|
20
|
-
const val = target[prop];
|
|
21
|
-
if (typeof val === "object" && val !== null)
|
|
22
|
-
return flattenState({
|
|
23
|
-
rootState: val,
|
|
24
|
-
localState: void 0,
|
|
25
|
-
rootSetState: rootSetState ? (subState) => {
|
|
26
|
-
target[prop] = subState;
|
|
27
|
-
rootSetState(target);
|
|
28
|
-
} : void 0
|
|
29
|
-
});
|
|
30
|
-
return val;
|
|
31
|
-
},
|
|
32
|
-
set: (target, prop, value) => {
|
|
33
|
-
if (localState && prop in localState)
|
|
34
|
-
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
35
|
-
target[prop] = value;
|
|
36
|
-
rootSetState == null ? void 0 : rootSetState(target);
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
15
|
export {
|
|
42
|
-
flattenState,
|
|
43
16
|
runInBrowser
|
|
44
17
|
};
|
|
@@ -4,5 +4,7 @@ const build = require("@builder.io/qwik/build");
|
|
|
4
4
|
const browser = require("./browser-runtime/browser.qwik.cjs");
|
|
5
5
|
const edgeRuntime = require("./edge-runtime/edge-runtime.qwik.cjs");
|
|
6
6
|
const shouldForceBrowserRuntimeInNode = require("./should-force-browser-runtime-in-node.qwik.cjs");
|
|
7
|
-
const chooseBrowserOrServerEval = (args) => build.isBrowser || shouldForceBrowserRuntimeInNode.shouldForceBrowserRuntimeInNode(
|
|
7
|
+
const chooseBrowserOrServerEval = (args) => build.isBrowser || shouldForceBrowserRuntimeInNode.shouldForceBrowserRuntimeInNode({
|
|
8
|
+
shouldLogWarning: true
|
|
9
|
+
}) ? browser.runInBrowser(args) : edgeRuntime.runInEdge(args);
|
|
8
10
|
exports.chooseBrowserOrServerEval = chooseBrowserOrServerEval;
|
|
@@ -2,7 +2,9 @@ import { isBrowser } from "@builder.io/qwik/build";
|
|
|
2
2
|
import { runInBrowser } from "./browser-runtime/browser.qwik.mjs";
|
|
3
3
|
import { runInEdge } from "./edge-runtime/edge-runtime.qwik.mjs";
|
|
4
4
|
import { shouldForceBrowserRuntimeInNode } from "./should-force-browser-runtime-in-node.qwik.mjs";
|
|
5
|
-
const chooseBrowserOrServerEval = (args) => isBrowser || shouldForceBrowserRuntimeInNode(
|
|
5
|
+
const chooseBrowserOrServerEval = (args) => isBrowser || shouldForceBrowserRuntimeInNode({
|
|
6
|
+
shouldLogWarning: true
|
|
7
|
+
}) ? runInBrowser(args) : runInEdge(args);
|
|
6
8
|
export {
|
|
7
9
|
chooseBrowserOrServerEval
|
|
8
10
|
};
|
|
@@ -2072,7 +2072,7 @@ p.g = function(a, b, d, c) {
|
|
|
2072
2072
|
return;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
|
-
if ("Array" === a.H)
|
|
2075
|
+
if ("Array" === a.H)
|
|
2076
2076
|
if (h = a.h.length, "length" === b) {
|
|
2077
2077
|
if (c) {
|
|
2078
2078
|
if (!("value" in c))
|
|
@@ -2088,7 +2088,6 @@ p.g = function(a, b, d, c) {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
} else
|
|
2090
2090
|
isNaN(k = Qa(b)) || (a.h.length = Math.max(h, k + 1));
|
|
2091
|
-
}
|
|
2092
2091
|
if (!a.preventExtensions || b in a.h) {
|
|
2093
2092
|
if (c) {
|
|
2094
2093
|
e = {};
|
|
@@ -2225,14 +2224,15 @@ function Ra(a, b, d) {
|
|
|
2225
2224
|
if ("loc" !== k) {
|
|
2226
2225
|
var q = b[k];
|
|
2227
2226
|
if (q && "object" === typeof q) {
|
|
2228
|
-
if (Array.isArray(q))
|
|
2229
|
-
for (e = 0; e < q.length; e++)
|
|
2227
|
+
if (Array.isArray(q))
|
|
2228
|
+
for (e = 0; e < q.length; e++) {
|
|
2230
2229
|
if (q[e] && q[e].constructor === h) {
|
|
2231
2230
|
var C = Ra(a, q[e], d);
|
|
2232
2231
|
for (k in C)
|
|
2233
2232
|
c[k] = C[k];
|
|
2234
2233
|
}
|
|
2235
|
-
|
|
2234
|
+
}
|
|
2235
|
+
else if (q.constructor === h)
|
|
2236
2236
|
for (k in C = Ra(a, q, d), C)
|
|
2237
2237
|
c[k] = C[k];
|
|
2238
2238
|
}
|
|
@@ -2839,7 +2839,7 @@ t.prototype.stepForInStatement = function(a, b, d) {
|
|
|
2839
2839
|
return;
|
|
2840
2840
|
}
|
|
2841
2841
|
}
|
|
2842
|
-
if (!b.wb)
|
|
2842
|
+
if (!b.wb)
|
|
2843
2843
|
if (b.wb = true, a = d.left, "VariableDeclaration" === a.type)
|
|
2844
2844
|
b.pa = [
|
|
2845
2845
|
Ha,
|
|
@@ -2847,7 +2847,6 @@ t.prototype.stepForInStatement = function(a, b, d) {
|
|
|
2847
2847
|
];
|
|
2848
2848
|
else
|
|
2849
2849
|
return b.pa = null, b = new u(a, b.scope), b.sa = true, b;
|
|
2850
|
-
}
|
|
2851
2850
|
b.pa || (b.pa = b.value);
|
|
2852
2851
|
if (!b.ta && (b.ta = true, a = b.Ra, c = gd(this, b.pa, a)))
|
|
2853
2852
|
return kd(this, c, b.pa, a);
|
|
@@ -2071,7 +2071,7 @@ p.g = function(a, b, d, c) {
|
|
|
2071
2071
|
return;
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
2074
|
-
if ("Array" === a.H)
|
|
2074
|
+
if ("Array" === a.H)
|
|
2075
2075
|
if (h = a.h.length, "length" === b) {
|
|
2076
2076
|
if (c) {
|
|
2077
2077
|
if (!("value" in c))
|
|
@@ -2087,7 +2087,6 @@ p.g = function(a, b, d, c) {
|
|
|
2087
2087
|
}
|
|
2088
2088
|
} else
|
|
2089
2089
|
isNaN(k = Qa(b)) || (a.h.length = Math.max(h, k + 1));
|
|
2090
|
-
}
|
|
2091
2090
|
if (!a.preventExtensions || b in a.h) {
|
|
2092
2091
|
if (c) {
|
|
2093
2092
|
e = {};
|
|
@@ -2224,14 +2223,15 @@ function Ra(a, b, d) {
|
|
|
2224
2223
|
if ("loc" !== k) {
|
|
2225
2224
|
var q = b[k];
|
|
2226
2225
|
if (q && "object" === typeof q) {
|
|
2227
|
-
if (Array.isArray(q))
|
|
2228
|
-
for (e = 0; e < q.length; e++)
|
|
2226
|
+
if (Array.isArray(q))
|
|
2227
|
+
for (e = 0; e < q.length; e++) {
|
|
2229
2228
|
if (q[e] && q[e].constructor === h) {
|
|
2230
2229
|
var C = Ra(a, q[e], d);
|
|
2231
2230
|
for (k in C)
|
|
2232
2231
|
c[k] = C[k];
|
|
2233
2232
|
}
|
|
2234
|
-
|
|
2233
|
+
}
|
|
2234
|
+
else if (q.constructor === h)
|
|
2235
2235
|
for (k in C = Ra(a, q, d), C)
|
|
2236
2236
|
c[k] = C[k];
|
|
2237
2237
|
}
|
|
@@ -2838,7 +2838,7 @@ t.prototype.stepForInStatement = function(a, b, d) {
|
|
|
2838
2838
|
return;
|
|
2839
2839
|
}
|
|
2840
2840
|
}
|
|
2841
|
-
if (!b.wb)
|
|
2841
|
+
if (!b.wb)
|
|
2842
2842
|
if (b.wb = true, a = d.left, "VariableDeclaration" === a.type)
|
|
2843
2843
|
b.pa = [
|
|
2844
2844
|
Ha,
|
|
@@ -2846,7 +2846,6 @@ t.prototype.stepForInStatement = function(a, b, d) {
|
|
|
2846
2846
|
];
|
|
2847
2847
|
else
|
|
2848
2848
|
return b.pa = null, b = new u(a, b.scope), b.sa = true, b;
|
|
2849
|
-
}
|
|
2850
2849
|
b.pa || (b.pa = b.value);
|
|
2851
2850
|
if (!b.ta && (b.ta = true, a = b.Ra, c = gd(this, b.pa, a)))
|
|
2852
2851
|
return kd(this, c, b.pa, a);
|
|
@@ -1,32 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const logger = require("../../../helpers/logger.qwik.cjs");
|
|
4
|
-
const set = require("../../set.qwik.cjs");
|
|
5
4
|
const helpers = require("../helpers.qwik.cjs");
|
|
6
5
|
const acornInterpreter = require("./acorn-interpreter.qwik.cjs");
|
|
6
|
+
function patchInterpreter() {
|
|
7
|
+
const originalGetProperty = acornInterpreter.prototype.getProperty;
|
|
8
|
+
const originalSetProperty = acornInterpreter.prototype.setProperty;
|
|
9
|
+
function newGetProperty(obj, name) {
|
|
10
|
+
if (obj == null || !obj._connected) {
|
|
11
|
+
return originalGetProperty.call(this, obj, name);
|
|
12
|
+
}
|
|
13
|
+
const value = obj._connected[name];
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
return this.nativeToPseudo(value);
|
|
16
|
+
}
|
|
17
|
+
if (typeof value === "object") {
|
|
18
|
+
return this.createConnectedObject(value);
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function newSetProperty(obj, name, value, opt_descriptor) {
|
|
23
|
+
if (obj == null || !obj._connected) {
|
|
24
|
+
return originalSetProperty.call(this, obj, name, value, opt_descriptor);
|
|
25
|
+
}
|
|
26
|
+
obj._connected[name] = this.pseudoToNative(value);
|
|
27
|
+
}
|
|
28
|
+
const getKeys = [];
|
|
29
|
+
const setKeys = [];
|
|
30
|
+
for (const key of Object.keys(acornInterpreter.prototype)) {
|
|
31
|
+
if (acornInterpreter.prototype[key] === originalGetProperty) {
|
|
32
|
+
getKeys.push(key);
|
|
33
|
+
}
|
|
34
|
+
if (acornInterpreter.prototype[key] === originalSetProperty) {
|
|
35
|
+
setKeys.push(key);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const key of getKeys) {
|
|
39
|
+
acornInterpreter.prototype[key] = newGetProperty;
|
|
40
|
+
}
|
|
41
|
+
for (const key of setKeys) {
|
|
42
|
+
acornInterpreter.prototype[key] = newSetProperty;
|
|
43
|
+
}
|
|
44
|
+
acornInterpreter.prototype.createConnectedObject = function(obj) {
|
|
45
|
+
const connectedObject = this.createObject(this.OBJECT);
|
|
46
|
+
connectedObject._connected = obj;
|
|
47
|
+
return connectedObject;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
patchInterpreter();
|
|
7
51
|
const processCode = (code) => {
|
|
8
|
-
return code.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const isStateSetter = trimmed.startsWith("state.");
|
|
13
|
-
if (!isStateSetter)
|
|
14
|
-
return line;
|
|
15
|
-
const [lhs, rhs] = trimmed.split("=");
|
|
16
|
-
const setStr = lhs.replace("state.", "").trim();
|
|
17
|
-
const setExpr = `setRootState('${setStr}', ${rhs.trim()})`;
|
|
18
|
-
return `
|
|
19
|
-
${line}
|
|
20
|
-
${setExpr}
|
|
21
|
-
`;
|
|
22
|
-
}).filter(Boolean).join("\n");
|
|
52
|
+
return code.replace(/^.*?function main\(\)/, `
|
|
53
|
+
var __awaiter = function (e, t, n, r) {return r()},
|
|
54
|
+
__generator = function (e, t) { return t() };
|
|
55
|
+
function main()`).replace(/\?\./g, ".");
|
|
23
56
|
};
|
|
24
57
|
const getJSONValName = (val) => val + "JSON";
|
|
25
58
|
const runInEdge = ({ builder, context, event, rootState, localState, rootSetState, code }) => {
|
|
26
|
-
const state = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
59
|
+
const state = helpers.flattenState({
|
|
60
|
+
rootState,
|
|
61
|
+
localState,
|
|
62
|
+
rootSetState
|
|
63
|
+
});
|
|
30
64
|
const properties = helpers.getFunctionArguments({
|
|
31
65
|
builder,
|
|
32
66
|
context,
|
|
@@ -35,6 +69,9 @@ const runInEdge = ({ builder, context, event, rootState, localState, rootSetStat
|
|
|
35
69
|
});
|
|
36
70
|
const prependedCode = properties.map(([key]) => {
|
|
37
71
|
const jsonValName = getJSONValName(key);
|
|
72
|
+
if (key === "state") {
|
|
73
|
+
return ``;
|
|
74
|
+
}
|
|
38
75
|
return `var ${key} = ${jsonValName} === undefined ? undefined : JSON.parse(${jsonValName});`;
|
|
39
76
|
}).join("\n");
|
|
40
77
|
const cleanedCode = processCode(code);
|
|
@@ -50,16 +87,15 @@ function theFunction() {
|
|
|
50
87
|
}
|
|
51
88
|
theFunction();
|
|
52
89
|
`;
|
|
53
|
-
const setRootState = (prop, value) => {
|
|
54
|
-
const newState = set.set(state, prop, value);
|
|
55
|
-
rootSetState == null ? void 0 : rootSetState(newState);
|
|
56
|
-
};
|
|
57
90
|
const initFunc = function(interpreter, globalObject) {
|
|
58
91
|
properties.forEach(([key, val]) => {
|
|
59
|
-
|
|
60
|
-
|
|
92
|
+
if (key === "state") {
|
|
93
|
+
interpreter.setProperty(globalObject, key, interpreter.createConnectedObject(val), interpreter.READONLY_DESCRIPTOR);
|
|
94
|
+
} else {
|
|
95
|
+
const jsonVal = JSON.stringify(val);
|
|
96
|
+
interpreter.setProperty(globalObject, getJSONValName(key), jsonVal);
|
|
97
|
+
}
|
|
61
98
|
});
|
|
62
|
-
interpreter.setProperty(globalObject, "setRootState", interpreter.createNativeFunction(setRootState));
|
|
63
99
|
};
|
|
64
100
|
const myInterpreter = new acornInterpreter(transformed, initFunc);
|
|
65
101
|
myInterpreter.run();
|
|
@@ -1,30 +1,64 @@
|
|
|
1
1
|
import { logger } from "../../../helpers/logger.qwik.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { getFunctionArguments } from "../helpers.qwik.mjs";
|
|
2
|
+
import { flattenState, getFunctionArguments } from "../helpers.qwik.mjs";
|
|
4
3
|
import t from "./acorn-interpreter.qwik.mjs";
|
|
4
|
+
function patchInterpreter() {
|
|
5
|
+
const originalGetProperty = t.prototype.getProperty;
|
|
6
|
+
const originalSetProperty = t.prototype.setProperty;
|
|
7
|
+
function newGetProperty(obj, name) {
|
|
8
|
+
if (obj == null || !obj._connected) {
|
|
9
|
+
return originalGetProperty.call(this, obj, name);
|
|
10
|
+
}
|
|
11
|
+
const value = obj._connected[name];
|
|
12
|
+
if (Array.isArray(value)) {
|
|
13
|
+
return this.nativeToPseudo(value);
|
|
14
|
+
}
|
|
15
|
+
if (typeof value === "object") {
|
|
16
|
+
return this.createConnectedObject(value);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function newSetProperty(obj, name, value, opt_descriptor) {
|
|
21
|
+
if (obj == null || !obj._connected) {
|
|
22
|
+
return originalSetProperty.call(this, obj, name, value, opt_descriptor);
|
|
23
|
+
}
|
|
24
|
+
obj._connected[name] = this.pseudoToNative(value);
|
|
25
|
+
}
|
|
26
|
+
const getKeys = [];
|
|
27
|
+
const setKeys = [];
|
|
28
|
+
for (const key of Object.keys(t.prototype)) {
|
|
29
|
+
if (t.prototype[key] === originalGetProperty) {
|
|
30
|
+
getKeys.push(key);
|
|
31
|
+
}
|
|
32
|
+
if (t.prototype[key] === originalSetProperty) {
|
|
33
|
+
setKeys.push(key);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
for (const key of getKeys) {
|
|
37
|
+
t.prototype[key] = newGetProperty;
|
|
38
|
+
}
|
|
39
|
+
for (const key of setKeys) {
|
|
40
|
+
t.prototype[key] = newSetProperty;
|
|
41
|
+
}
|
|
42
|
+
t.prototype.createConnectedObject = function(obj) {
|
|
43
|
+
const connectedObject = this.createObject(this.OBJECT);
|
|
44
|
+
connectedObject._connected = obj;
|
|
45
|
+
return connectedObject;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
patchInterpreter();
|
|
5
49
|
const processCode = (code) => {
|
|
6
|
-
return code.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const isStateSetter = trimmed.startsWith("state.");
|
|
11
|
-
if (!isStateSetter)
|
|
12
|
-
return line;
|
|
13
|
-
const [lhs, rhs] = trimmed.split("=");
|
|
14
|
-
const setStr = lhs.replace("state.", "").trim();
|
|
15
|
-
const setExpr = `setRootState('${setStr}', ${rhs.trim()})`;
|
|
16
|
-
return `
|
|
17
|
-
${line}
|
|
18
|
-
${setExpr}
|
|
19
|
-
`;
|
|
20
|
-
}).filter(Boolean).join("\n");
|
|
50
|
+
return code.replace(/^.*?function main\(\)/, `
|
|
51
|
+
var __awaiter = function (e, t, n, r) {return r()},
|
|
52
|
+
__generator = function (e, t) { return t() };
|
|
53
|
+
function main()`).replace(/\?\./g, ".");
|
|
21
54
|
};
|
|
22
55
|
const getJSONValName = (val) => val + "JSON";
|
|
23
56
|
const runInEdge = ({ builder, context, event, rootState, localState, rootSetState, code }) => {
|
|
24
|
-
const state = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
57
|
+
const state = flattenState({
|
|
58
|
+
rootState,
|
|
59
|
+
localState,
|
|
60
|
+
rootSetState
|
|
61
|
+
});
|
|
28
62
|
const properties = getFunctionArguments({
|
|
29
63
|
builder,
|
|
30
64
|
context,
|
|
@@ -33,6 +67,9 @@ const runInEdge = ({ builder, context, event, rootState, localState, rootSetStat
|
|
|
33
67
|
});
|
|
34
68
|
const prependedCode = properties.map(([key]) => {
|
|
35
69
|
const jsonValName = getJSONValName(key);
|
|
70
|
+
if (key === "state") {
|
|
71
|
+
return ``;
|
|
72
|
+
}
|
|
36
73
|
return `var ${key} = ${jsonValName} === undefined ? undefined : JSON.parse(${jsonValName});`;
|
|
37
74
|
}).join("\n");
|
|
38
75
|
const cleanedCode = processCode(code);
|
|
@@ -48,16 +85,15 @@ function theFunction() {
|
|
|
48
85
|
}
|
|
49
86
|
theFunction();
|
|
50
87
|
`;
|
|
51
|
-
const setRootState = (prop, value) => {
|
|
52
|
-
const newState = set(state, prop, value);
|
|
53
|
-
rootSetState == null ? void 0 : rootSetState(newState);
|
|
54
|
-
};
|
|
55
88
|
const initFunc = function(interpreter, globalObject) {
|
|
56
89
|
properties.forEach(([key, val]) => {
|
|
57
|
-
|
|
58
|
-
|
|
90
|
+
if (key === "state") {
|
|
91
|
+
interpreter.setProperty(globalObject, key, interpreter.createConnectedObject(val), interpreter.READONLY_DESCRIPTOR);
|
|
92
|
+
} else {
|
|
93
|
+
const jsonVal = JSON.stringify(val);
|
|
94
|
+
interpreter.setProperty(globalObject, getJSONValName(key), jsonVal);
|
|
95
|
+
}
|
|
59
96
|
});
|
|
60
|
-
interpreter.setProperty(globalObject, "setRootState", interpreter.createNativeFunction(setRootState));
|
|
61
97
|
};
|
|
62
98
|
const myInterpreter = new t(transformed, initFunc);
|
|
63
99
|
myInterpreter.run();
|
|
@@ -18,8 +18,9 @@ const _EvalCache = class _EvalCache2 {
|
|
|
18
18
|
return cachedVal;
|
|
19
19
|
}
|
|
20
20
|
static setCachedValue(key, value) {
|
|
21
|
-
if (_EvalCache2.cache.size > 20)
|
|
21
|
+
if (_EvalCache2.cache.size > 20) {
|
|
22
22
|
_EvalCache2.cache.delete(_EvalCache2.cache.keys().next().value);
|
|
23
|
+
}
|
|
23
24
|
_EvalCache2.cache.set(key, {
|
|
24
25
|
value
|
|
25
26
|
});
|
|
@@ -29,8 +30,9 @@ _EvalCache.cacheLimit = 20;
|
|
|
29
30
|
_EvalCache.cache = /* @__PURE__ */ new Map();
|
|
30
31
|
let EvalCache = _EvalCache;
|
|
31
32
|
function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression = true, enableCache }) {
|
|
32
|
-
if (code === "")
|
|
33
|
+
if (code === "") {
|
|
33
34
|
return void 0;
|
|
35
|
+
}
|
|
34
36
|
const args = {
|
|
35
37
|
code: helpers.parseCode(code, {
|
|
36
38
|
isExpression
|
|
@@ -45,8 +47,9 @@ function evaluate({ code, context, localState, rootState, rootSetState, event, i
|
|
|
45
47
|
if (enableCache && !DISABLE_CACHE) {
|
|
46
48
|
const cacheKey = EvalCache.getCacheKey(args);
|
|
47
49
|
const cachedValue = EvalCache.getCachedValue(cacheKey);
|
|
48
|
-
if (cachedValue)
|
|
50
|
+
if (cachedValue) {
|
|
49
51
|
return cachedValue.value;
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
try {
|
|
52
55
|
const newEval = chooseEval.chooseBrowserOrServerEval(args);
|
|
@@ -16,8 +16,9 @@ const _EvalCache = class _EvalCache2 {
|
|
|
16
16
|
return cachedVal;
|
|
17
17
|
}
|
|
18
18
|
static setCachedValue(key, value) {
|
|
19
|
-
if (_EvalCache2.cache.size > 20)
|
|
19
|
+
if (_EvalCache2.cache.size > 20) {
|
|
20
20
|
_EvalCache2.cache.delete(_EvalCache2.cache.keys().next().value);
|
|
21
|
+
}
|
|
21
22
|
_EvalCache2.cache.set(key, {
|
|
22
23
|
value
|
|
23
24
|
});
|
|
@@ -27,8 +28,9 @@ _EvalCache.cacheLimit = 20;
|
|
|
27
28
|
_EvalCache.cache = /* @__PURE__ */ new Map();
|
|
28
29
|
let EvalCache = _EvalCache;
|
|
29
30
|
function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression = true, enableCache }) {
|
|
30
|
-
if (code === "")
|
|
31
|
+
if (code === "") {
|
|
31
32
|
return void 0;
|
|
33
|
+
}
|
|
32
34
|
const args = {
|
|
33
35
|
code: parseCode(code, {
|
|
34
36
|
isExpression
|
|
@@ -43,8 +45,9 @@ function evaluate({ code, context, localState, rootState, rootSetState, event, i
|
|
|
43
45
|
if (enableCache && !DISABLE_CACHE) {
|
|
44
46
|
const cacheKey = EvalCache.getCacheKey(args);
|
|
45
47
|
const cachedValue = EvalCache.getCachedValue(cacheKey);
|
|
46
|
-
if (cachedValue)
|
|
48
|
+
if (cachedValue) {
|
|
47
49
|
return cachedValue.value;
|
|
50
|
+
}
|
|
48
51
|
}
|
|
49
52
|
try {
|
|
50
53
|
const newEval = chooseBrowserOrServerEval(args);
|
|
@@ -27,6 +27,36 @@ const parseCode = (code, { isExpression = true }) => {
|
|
|
27
27
|
const useCode = useReturn ? `return (${code});` : code;
|
|
28
28
|
return useCode;
|
|
29
29
|
};
|
|
30
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
31
|
+
return new Proxy(rootState, {
|
|
32
|
+
get: (target, prop) => {
|
|
33
|
+
if (localState && prop in localState) {
|
|
34
|
+
return localState[prop];
|
|
35
|
+
}
|
|
36
|
+
const val = target[prop];
|
|
37
|
+
if (typeof val === "object" && val !== null) {
|
|
38
|
+
return flattenState({
|
|
39
|
+
rootState: val,
|
|
40
|
+
localState: void 0,
|
|
41
|
+
rootSetState: rootSetState ? (subState) => {
|
|
42
|
+
target[prop] = subState;
|
|
43
|
+
rootSetState(target);
|
|
44
|
+
} : void 0
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return val;
|
|
48
|
+
},
|
|
49
|
+
set: (target, prop, value) => {
|
|
50
|
+
if (localState && prop in localState) {
|
|
51
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
52
|
+
}
|
|
53
|
+
target[prop] = value;
|
|
54
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
exports.flattenState = flattenState;
|
|
30
60
|
exports.getBuilderGlobals = getBuilderGlobals;
|
|
31
61
|
exports.getFunctionArguments = getFunctionArguments;
|
|
32
62
|
exports.parseCode = parseCode;
|
|
@@ -25,7 +25,37 @@ const parseCode = (code, { isExpression = true }) => {
|
|
|
25
25
|
const useCode = useReturn ? `return (${code});` : code;
|
|
26
26
|
return useCode;
|
|
27
27
|
};
|
|
28
|
+
function flattenState({ rootState, localState, rootSetState }) {
|
|
29
|
+
return new Proxy(rootState, {
|
|
30
|
+
get: (target, prop) => {
|
|
31
|
+
if (localState && prop in localState) {
|
|
32
|
+
return localState[prop];
|
|
33
|
+
}
|
|
34
|
+
const val = target[prop];
|
|
35
|
+
if (typeof val === "object" && val !== null) {
|
|
36
|
+
return flattenState({
|
|
37
|
+
rootState: val,
|
|
38
|
+
localState: void 0,
|
|
39
|
+
rootSetState: rootSetState ? (subState) => {
|
|
40
|
+
target[prop] = subState;
|
|
41
|
+
rootSetState(target);
|
|
42
|
+
} : void 0
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return val;
|
|
46
|
+
},
|
|
47
|
+
set: (target, prop, value) => {
|
|
48
|
+
if (localState && prop in localState) {
|
|
49
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
50
|
+
}
|
|
51
|
+
target[prop] = value;
|
|
52
|
+
rootSetState == null ? void 0 : rootSetState(target);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
28
57
|
export {
|
|
58
|
+
flattenState,
|
|
29
59
|
getBuilderGlobals,
|
|
30
60
|
getFunctionArguments,
|
|
31
61
|
parseCode
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const logger = require("../../helpers/logger.qwik.cjs");
|
|
4
4
|
const isNodeRuntime = require("../is-node-runtime.qwik.cjs");
|
|
5
|
-
const shouldForceBrowserRuntimeInNode = () => {
|
|
5
|
+
const shouldForceBrowserRuntimeInNode = ({ shouldLogWarning }) => {
|
|
6
6
|
var _a;
|
|
7
7
|
if (!isNodeRuntime.isNodeRuntime())
|
|
8
8
|
return false;
|
|
@@ -10,10 +10,12 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
10
10
|
const isNode20 = process.version.startsWith("v20");
|
|
11
11
|
const hasNoNodeSnapshotNodeOption = (_a = process.env.NODE_OPTIONS) == null ? void 0 : _a.includes("--no-node-snapshot");
|
|
12
12
|
if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
|
|
13
|
-
|
|
13
|
+
if (shouldLogWarning) {
|
|
14
|
+
logger.logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
|
|
14
15
|
If you would like to use the \`isolated-vm\` package on this machine, please provide the \`NODE_OPTIONS=--no-node-snapshot\` config to your Node process.
|
|
15
16
|
See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
|
|
16
17
|
`);
|
|
18
|
+
}
|
|
17
19
|
return true;
|
|
18
20
|
}
|
|
19
21
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logger } from "../../helpers/logger.qwik.mjs";
|
|
2
2
|
import { isNodeRuntime } from "../is-node-runtime.qwik.mjs";
|
|
3
|
-
const shouldForceBrowserRuntimeInNode = () => {
|
|
3
|
+
const shouldForceBrowserRuntimeInNode = ({ shouldLogWarning }) => {
|
|
4
4
|
var _a;
|
|
5
5
|
if (!isNodeRuntime())
|
|
6
6
|
return false;
|
|
@@ -8,10 +8,12 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
8
8
|
const isNode20 = process.version.startsWith("v20");
|
|
9
9
|
const hasNoNodeSnapshotNodeOption = (_a = process.env.NODE_OPTIONS) == null ? void 0 : _a.includes("--no-node-snapshot");
|
|
10
10
|
if (isArm64 && isNode20 && !hasNoNodeSnapshotNodeOption) {
|
|
11
|
-
|
|
11
|
+
if (shouldLogWarning) {
|
|
12
|
+
logger.log(`Skipping usage of \`isolated-vm\` to avoid crashes in Node v20 on an arm64 machine.
|
|
12
13
|
If you would like to use the \`isolated-vm\` package on this machine, please provide the \`NODE_OPTIONS=--no-node-snapshot\` config to your Node process.
|
|
13
14
|
See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.
|
|
14
15
|
`);
|
|
16
|
+
}
|
|
15
17
|
return true;
|
|
16
18
|
}
|
|
17
19
|
return false;
|
|
@@ -3,20 +3,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
4
|
const evaluate = require("./evaluate/evaluate.qwik.cjs");
|
|
5
5
|
function createEventHandler(value, options) {
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
enableCache: true
|
|
16
|
-
});
|
|
17
|
-
}, "createEventHandler_7wCAiJVliNE", [
|
|
18
|
-
options,
|
|
19
|
-
value
|
|
20
|
-
]);
|
|
6
|
+
return qwik.$((event) => evaluate.evaluate({
|
|
7
|
+
code: value,
|
|
8
|
+
context: options.context,
|
|
9
|
+
localState: options.localState,
|
|
10
|
+
rootState: options.rootState,
|
|
11
|
+
rootSetState: options.rootSetState,
|
|
12
|
+
event,
|
|
13
|
+
enableCache: true
|
|
14
|
+
}));
|
|
21
15
|
}
|
|
22
16
|
exports.createEventHandler = createEventHandler;
|