@builder.io/sdk-vue 0.6.4 → 0.7.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -2
- package/vue2/lib/{node/block-f8ec39b9.cjs → browser/block-b12c2a9e.cjs} +2 -2
- package/vue2/lib/browser/{block-7623343e.js → block-d44d5b8a.js} +7 -7
- package/vue2/lib/{node/block-styles-78f1fc51.js → browser/block-styles-b2bcecac.js} +5 -5
- package/vue2/lib/{edge/block-styles-d41b334a.cjs → browser/block-styles-fad43b2e.cjs} +1 -1
- package/vue2/lib/browser/{block-wrapper-d129f149.js → block-wrapper-230a8abf.js} +5 -5
- package/vue2/lib/browser/{block-wrapper-04c09786.cjs → block-wrapper-ecdc5285.cjs} +1 -1
- package/vue2/lib/browser/blocks/custom-code/custom-code.vue.d.ts +0 -1
- package/vue2/lib/browser/blocks/image/image.vue.d.ts +1 -1
- package/vue2/lib/{edge/blocks-wrapper-d1b2c241.js → browser/blocks-wrapper-37d1fbf5.js} +1 -1
- package/vue2/lib/{edge/blocks-wrapper-c1a59075.cjs → browser/blocks-wrapper-5f4ff269.cjs} +1 -1
- package/vue2/lib/{edge/component-ref-bac7483e.js → browser/component-ref-25028977.js} +6 -6
- package/vue2/lib/{edge/component-ref-f49d33aa.cjs → browser/component-ref-8d39a7f4.cjs} +1 -1
- package/vue2/lib/browser/components/content/components/enable-editor.vue.d.ts +2 -1
- package/vue2/lib/browser/constants/sdk-version.d.ts +1 -1
- package/vue2/lib/{edge/content-ee5058bf.cjs → browser/content-e0b5be50.cjs} +1 -1
- package/vue2/lib/browser/{content-59001c88.js → content-e775e1b1.js} +66 -68
- package/vue2/lib/browser/{css-5244a373.js → css-41c2e31d.js} +1 -1
- package/vue2/lib/{node/css-e268cc90.cjs → browser/css-c292bae4.cjs} +1 -1
- package/vue2/lib/{node/enable-editor-0ec0fba2.js → browser/enable-editor-836e8731.js} +104 -90
- package/vue2/lib/browser/enable-editor-bf828ceb.cjs +1 -0
- package/vue2/lib/browser/evaluate-239c4f2e.js +86 -0
- package/vue2/lib/browser/evaluate-37bcc296.cjs +1 -0
- package/vue2/lib/browser/functions/evaluate/choose-eval.d.ts +6 -0
- package/vue2/lib/browser/functions/evaluate/evaluate.d.ts +1 -5
- package/vue2/lib/browser/functions/evaluate/helpers.d.ts +7 -1
- package/vue2/lib/browser/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/vue2/lib/browser/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/vue2/lib/browser/functions/get-content/types.d.ts +94 -3
- package/vue2/lib/browser/functions/is-node-runtime.d.ts +4 -0
- package/vue2/lib/browser/{get-block-actions-72575937.cjs → get-block-actions-0e6055b8.cjs} +1 -1
- package/vue2/lib/{node/get-block-actions-19c074c1.js → browser/get-block-actions-eb308dbc.js} +2 -2
- package/vue2/lib/{node/get-block-properties-a61a4f44.cjs → browser/get-block-properties-a17c5ae7.cjs} +1 -1
- package/vue2/lib/browser/{get-block-properties-8bd6705f.js → get-block-properties-f1d87f5b.js} +2 -2
- package/vue2/lib/browser/{get-processed-block-df5bc2af.cjs → get-processed-block-469b6014.cjs} +1 -1
- package/vue2/lib/{node/get-processed-block-5ea5ad51.js → browser/get-processed-block-dac77b11.js} +2 -2
- package/vue2/lib/browser/index-0daf250a.cjs +32 -0
- package/vue2/lib/{node/index-cd218de0.js → browser/index-2c3e3aa0.js} +389 -370
- package/vue2/lib/browser/index.cjs +1 -1
- package/vue2/lib/browser/index.js +5 -5
- package/vue2/lib/browser/{inlined-script-b9da40ba.cjs → inlined-script-17a3e298.cjs} +1 -1
- package/vue2/lib/{edge/inlined-script-1c876548.js → browser/inlined-script-a2ce7e25.js} +1 -1
- package/vue2/lib/{node/inlined-styles-86ba9613.cjs → browser/inlined-styles-02129d25.cjs} +1 -1
- package/vue2/lib/{node/inlined-styles-cb8ac12b.js → browser/inlined-styles-25974197.js} +1 -1
- package/vue2/lib/{node/interactive-element-7034b3c2.cjs → browser/interactive-element-31618273.cjs} +1 -1
- package/vue2/lib/{node/interactive-element-c2e016e7.js → browser/interactive-element-95e7ed70.js} +5 -5
- package/vue2/lib/browser/{repeated-block-515aea68.cjs → repeated-block-dc24507b.cjs} +1 -1
- package/vue2/lib/{node/repeated-block-82b3437a.js → browser/repeated-block-df873ea1.js} +2 -2
- package/vue2/lib/browser/style.css +1 -1
- package/vue2/lib/{node/styles-b9bdec6e.js → browser/styles-c0e6af8c.js} +2 -2
- package/vue2/lib/{node/styles-f43008cc.cjs → browser/styles-eb6d5133.cjs} +2 -2
- package/vue2/lib/{browser/block-f8ec39b9.cjs → edge/block-6ae253d3.cjs} +2 -2
- package/vue2/lib/edge/{block-9a136438.js → block-ee5e6b30.js} +7 -7
- package/vue2/lib/{node/block-styles-442c9444.cjs → edge/block-styles-0db05976.cjs} +1 -1
- package/vue2/lib/edge/{block-styles-293e6520.js → block-styles-7ddd1160.js} +5 -5
- package/vue2/lib/{node/block-wrapper-d129f149.js → edge/block-wrapper-2516c8f0.js} +5 -5
- package/vue2/lib/edge/{block-wrapper-e6bc8771.cjs → block-wrapper-4a546b0f.cjs} +1 -1
- package/vue2/lib/edge/blocks/custom-code/custom-code.vue.d.ts +0 -1
- package/vue2/lib/edge/blocks/image/image.vue.d.ts +1 -1
- package/vue2/lib/{browser/blocks-wrapper-ffcf193b.cjs → edge/blocks-wrapper-be115723.cjs} +1 -1
- package/vue2/lib/{browser/blocks-wrapper-744d9c88.js → edge/blocks-wrapper-f30c1e2e.js} +1 -1
- package/vue2/lib/{node/component-ref-ad91463a.js → edge/component-ref-7ca49e69.js} +6 -6
- package/vue2/lib/{node/component-ref-c0bc64bb.cjs → edge/component-ref-f5f09e76.cjs} +1 -1
- package/vue2/lib/edge/components/content/components/enable-editor.vue.d.ts +2 -1
- package/vue2/lib/edge/constants/sdk-version.d.ts +1 -1
- package/vue2/lib/edge/{content-dd98b5f2.js → content-32e8afd0.js} +66 -68
- package/vue2/lib/{browser/content-6391e001.cjs → edge/content-e389cb08.cjs} +1 -1
- package/vue2/lib/edge/{css-a40d0ce1.js → css-905123d6.js} +1 -1
- package/vue2/lib/{browser/css-e268cc90.cjs → edge/css-db1fb81d.cjs} +1 -1
- package/vue2/lib/{browser/enable-editor-0ec0fba2.js → edge/enable-editor-5339c72b.js} +104 -90
- package/vue2/lib/edge/enable-editor-8460bc4f.cjs +1 -0
- package/vue2/lib/edge/evaluate-7b0fdb29.cjs +21 -0
- package/vue2/lib/edge/{evaluate-5aed4676.js → evaluate-8d6921da.js} +379 -346
- package/vue2/lib/edge/functions/evaluate/choose-eval.d.ts +6 -0
- package/vue2/lib/edge/functions/evaluate/evaluate.d.ts +1 -5
- package/vue2/lib/edge/functions/evaluate/helpers.d.ts +7 -1
- package/vue2/lib/edge/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/vue2/lib/edge/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/vue2/lib/edge/functions/get-content/types.d.ts +94 -3
- package/vue2/lib/edge/functions/is-node-runtime.d.ts +4 -0
- package/vue2/lib/edge/{get-block-actions-877fd5f9.cjs → get-block-actions-ac5cd221.cjs} +1 -1
- package/vue2/lib/{browser/get-block-actions-19c074c1.js → edge/get-block-actions-eb1322f1.js} +2 -2
- package/vue2/lib/{browser/get-block-properties-a61a4f44.cjs → edge/get-block-properties-e45bd13c.cjs} +1 -1
- package/vue2/lib/edge/{get-block-properties-8b0da7b7.js → get-block-properties-fc55bc69.js} +2 -2
- package/vue2/lib/edge/{get-processed-block-ccaa4214.cjs → get-processed-block-3a429bb7.cjs} +1 -1
- package/vue2/lib/edge/{get-processed-block-f0bfcc66.js → get-processed-block-9e3229f1.js} +2 -2
- package/vue2/lib/edge/{index-f8dc2e35.js → index-0840538e.js} +389 -370
- package/vue2/lib/edge/index-66f83dfa.cjs +32 -0
- package/vue2/lib/edge/index.cjs +1 -1
- package/vue2/lib/edge/index.js +5 -5
- package/vue2/lib/{node/inlined-script-4f903f8e.js → edge/inlined-script-8ceab368.js} +1 -1
- package/vue2/lib/{node/inlined-script-b9da40ba.cjs → edge/inlined-script-9311a8f4.cjs} +1 -1
- package/vue2/lib/edge/{inlined-styles-7ebd6646.js → inlined-styles-4826f427.js} +1 -1
- package/vue2/lib/{browser/inlined-styles-86ba9613.cjs → edge/inlined-styles-f0c5389f.cjs} +1 -1
- package/vue2/lib/edge/{interactive-element-3eaf0e7a.cjs → interactive-element-20464160.cjs} +1 -1
- package/vue2/lib/{browser/interactive-element-c2e016e7.js → edge/interactive-element-a4e1753a.js} +5 -5
- package/vue2/lib/{browser/repeated-block-82b3437a.js → edge/repeated-block-5ff563c4.js} +2 -2
- package/vue2/lib/edge/{repeated-block-446ae014.cjs → repeated-block-90ff0a8e.cjs} +1 -1
- package/vue2/lib/edge/style.css +1 -1
- package/vue2/lib/{browser/styles-b9bdec6e.js → edge/styles-0821e7bd.js} +2 -2
- package/vue2/lib/{browser/styles-f43008cc.cjs → edge/styles-8e148f6b.cjs} +2 -2
- package/vue2/lib/{edge/block-33134063.cjs → node/block-46a1926a.cjs} +2 -2
- package/vue2/lib/node/{block-7623343e.js → block-a1bcdc0f.js} +7 -7
- package/vue2/lib/{browser/block-styles-442c9444.cjs → node/block-styles-34b37b5f.cjs} +1 -1
- package/vue2/lib/{browser/block-styles-78f1fc51.js → node/block-styles-40dfb747.js} +5 -5
- package/vue2/lib/{edge/block-wrapper-2f05e945.js → node/block-wrapper-02a13832.js} +5 -5
- package/vue2/lib/node/{block-wrapper-04c09786.cjs → block-wrapper-d012bc77.cjs} +1 -1
- package/vue2/lib/node/blocks/custom-code/custom-code.vue.d.ts +0 -1
- package/vue2/lib/node/blocks/image/image.vue.d.ts +1 -1
- package/vue2/lib/node/{blocks-wrapper-ffcf193b.cjs → blocks-wrapper-111adf2e.cjs} +1 -1
- package/vue2/lib/node/{blocks-wrapper-744d9c88.js → blocks-wrapper-2cf7c243.js} +1 -1
- package/vue2/lib/{browser/component-ref-ad91463a.js → node/component-ref-686b70a8.js} +6 -6
- package/vue2/lib/{browser/component-ref-c0bc64bb.cjs → node/component-ref-8664d291.cjs} +1 -1
- package/vue2/lib/node/components/content/components/enable-editor.vue.d.ts +2 -1
- package/vue2/lib/node/constants/sdk-version.d.ts +1 -1
- package/vue2/lib/node/{content-59001c88.js → content-750b77c5.js} +66 -68
- package/vue2/lib/node/{content-6391e001.cjs → content-804eb1c1.cjs} +1 -1
- package/vue2/lib/node/{css-5244a373.js → css-0997fa70.js} +1 -1
- package/vue2/lib/{edge/css-6d51b919.cjs → node/css-698817f7.cjs} +1 -1
- package/vue2/lib/node/enable-editor-4c3b62ba.cjs +1 -0
- package/vue2/lib/{edge/enable-editor-aeb1f840.js → node/enable-editor-991cf703.js} +104 -90
- package/vue2/lib/node/evaluate-06bae117.js +187 -0
- package/vue2/lib/node/evaluate-fc74c806.cjs +41 -0
- package/vue2/lib/node/functions/evaluate/choose-eval.d.ts +6 -0
- package/vue2/lib/node/functions/evaluate/evaluate.d.ts +1 -5
- package/vue2/lib/node/functions/evaluate/helpers.d.ts +7 -1
- package/vue2/lib/node/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/vue2/lib/node/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/vue2/lib/node/functions/get-content/types.d.ts +94 -3
- package/vue2/lib/node/functions/is-node-runtime.d.ts +4 -0
- package/vue2/lib/node/{get-block-actions-72575937.cjs → get-block-actions-779fa30b.cjs} +1 -1
- package/vue2/lib/{edge/get-block-actions-350bc978.js → node/get-block-actions-9781c926.js} +2 -2
- package/vue2/lib/{edge/get-block-properties-ece4e040.cjs → node/get-block-properties-090f2906.cjs} +1 -1
- package/vue2/lib/node/{get-block-properties-8bd6705f.js → get-block-properties-ed8d55a8.js} +2 -2
- package/vue2/lib/node/get-processed-block-267a96eb.js +52 -0
- package/vue2/lib/node/get-processed-block-270c0450.cjs +1 -0
- package/vue2/lib/node/index-55b86b2c.cjs +32 -0
- package/vue2/lib/{browser/index-cd218de0.js → node/index-fe4f9482.js} +389 -370
- package/vue2/lib/node/index.cjs +1 -1
- package/vue2/lib/node/index.js +5 -5
- package/vue2/lib/{edge/inlined-script-44721dc7.cjs → node/inlined-script-37af305a.cjs} +1 -1
- package/vue2/lib/{browser/inlined-script-4f903f8e.js → node/inlined-script-9bf9544a.js} +1 -1
- package/vue2/lib/{browser/inlined-styles-cb8ac12b.js → node/inlined-styles-7a704065.js} +1 -1
- package/vue2/lib/{edge/inlined-styles-eb80e4fe.cjs → node/inlined-styles-e812d54a.cjs} +1 -1
- package/vue2/lib/{edge/interactive-element-64d11339.js → node/interactive-element-a9adc81f.js} +5 -5
- package/vue2/lib/{browser/interactive-element-7034b3c2.cjs → node/interactive-element-e940e56b.cjs} +1 -1
- package/vue2/lib/{edge/repeated-block-b9a8feeb.js → node/repeated-block-acab5426.js} +2 -2
- package/vue2/lib/node/{repeated-block-515aea68.cjs → repeated-block-ef2bf12f.cjs} +1 -1
- package/vue2/lib/node/style.css +1 -1
- package/vue2/lib/{edge/styles-cfea6654.js → node/styles-34c3741a.js} +2 -2
- package/vue2/lib/{edge/styles-36552ab4.cjs → node/styles-93f84a1d.cjs} +2 -2
- package/vue2/package.json +2 -0
- package/vue3/lib/browser/{block-wrapper.1501b793.cjs → block-wrapper.75f65d10.cjs} +1 -1
- package/vue3/lib/{edge/block-wrapper.e3b7b422.js → browser/block-wrapper.eb12cfdc.js} +2 -2
- package/vue3/lib/browser/blocks/custom-code/custom-code.vue.d.ts +0 -1
- package/vue3/lib/browser/blocks/image/image.vue.d.ts +1 -1
- package/vue3/lib/{edge/component-ref.7035b91b.js → browser/component-ref.ce36b7ec.js} +2 -2
- package/vue3/lib/browser/{component-ref.4f5f964f.cjs → component-ref.f391a5ee.cjs} +1 -1
- package/vue3/lib/browser/components/content/components/enable-editor.vue.d.ts +8 -7
- package/vue3/lib/browser/components/content/content.vue.d.ts +6 -6
- package/vue3/lib/browser/constants/sdk-version.d.ts +1 -1
- package/vue3/lib/browser/functions/evaluate/choose-eval.d.ts +6 -0
- package/vue3/lib/browser/functions/evaluate/evaluate.d.ts +1 -5
- package/vue3/lib/browser/functions/evaluate/helpers.d.ts +7 -1
- package/vue3/lib/browser/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/vue3/lib/browser/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/vue3/lib/browser/functions/get-content/types.d.ts +94 -3
- package/vue3/lib/browser/functions/is-node-runtime.d.ts +4 -0
- package/vue3/lib/{edge/get-block-actions.7d762289.js → browser/get-block-actions.7c580dff.js} +1 -1
- package/vue3/lib/{node/get-block-actions.316f88d7.cjs → browser/get-block-actions.e6dfffe3.cjs} +1 -1
- package/vue3/lib/{node/index.67caa0a0.js → browser/index.188d2ee5.js} +673 -640
- package/vue3/lib/browser/index.cjs +1 -1
- package/vue3/lib/browser/index.fb1c2a1f.cjs +69 -0
- package/vue3/lib/browser/index.js +1 -1
- package/vue3/lib/browser/{repeated-block.3a15e789.cjs → repeated-block.2431c33d.cjs} +1 -1
- package/vue3/lib/{edge/repeated-block.59223c04.js → browser/repeated-block.7a8762fc.js} +2 -2
- package/vue3/lib/browser/style.css +1 -1
- package/vue3/lib/edge/{block-wrapper.8441fbe1.cjs → block-wrapper.0868030f.cjs} +1 -1
- package/vue3/lib/{node/block-wrapper.d71006fa.js → edge/block-wrapper.cab4805b.js} +2 -2
- package/vue3/lib/edge/blocks/custom-code/custom-code.vue.d.ts +0 -1
- package/vue3/lib/edge/blocks/image/image.vue.d.ts +1 -1
- package/vue3/lib/{node/component-ref.104f0d16.js → edge/component-ref.ace67608.js} +2 -2
- package/vue3/lib/{node/component-ref.4f5f964f.cjs → edge/component-ref.ae7eec27.cjs} +1 -1
- package/vue3/lib/edge/components/content/components/enable-editor.vue.d.ts +8 -7
- package/vue3/lib/edge/components/content/content.vue.d.ts +6 -6
- package/vue3/lib/edge/constants/sdk-version.d.ts +1 -1
- package/vue3/lib/edge/functions/evaluate/choose-eval.d.ts +6 -0
- package/vue3/lib/edge/functions/evaluate/evaluate.d.ts +1 -5
- package/vue3/lib/edge/functions/evaluate/helpers.d.ts +7 -1
- package/vue3/lib/edge/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/vue3/lib/edge/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/vue3/lib/edge/functions/get-content/types.d.ts +94 -3
- package/vue3/lib/edge/functions/is-node-runtime.d.ts +4 -0
- package/vue3/lib/edge/{get-block-actions.37ab332e.cjs → get-block-actions.83fca99e.cjs} +1 -1
- package/vue3/lib/{browser/get-block-actions.12becb73.js → edge/get-block-actions.cfa7e625.js} +1 -1
- package/vue3/lib/edge/{index.811ded87.js → index.28b94406.js} +1310 -1249
- package/vue3/lib/edge/index.8e0db5cb.cjs +89 -0
- package/vue3/lib/edge/index.cjs +1 -1
- package/vue3/lib/edge/index.js +1 -1
- package/vue3/lib/edge/{repeated-block.2c467c57.cjs → repeated-block.4515ae00.cjs} +1 -1
- package/vue3/lib/{node/repeated-block.ab5e93b5.js → edge/repeated-block.4f0522f0.js} +2 -2
- package/vue3/lib/edge/style.css +1 -1
- package/vue3/lib/node/block-wrapper.4b048f0a.cjs +1 -0
- package/vue3/lib/{browser/block-wrapper.d71006fa.js → node/block-wrapper.529d85d5.js} +9 -8
- package/vue3/lib/node/blocks/custom-code/custom-code.vue.d.ts +0 -1
- package/vue3/lib/node/blocks/image/image.vue.d.ts +1 -1
- package/vue3/lib/{browser/component-ref.104f0d16.js → node/component-ref.3c9a0fb1.js} +5 -4
- package/vue3/lib/node/component-ref.c78bd861.cjs +1 -0
- package/vue3/lib/node/components/content/components/enable-editor.vue.d.ts +8 -7
- package/vue3/lib/node/components/content/content.vue.d.ts +6 -6
- package/vue3/lib/node/constants/sdk-version.d.ts +1 -1
- package/vue3/lib/node/functions/evaluate/choose-eval.d.ts +6 -0
- package/vue3/lib/node/functions/evaluate/evaluate.d.ts +1 -5
- package/vue3/lib/node/functions/evaluate/helpers.d.ts +7 -1
- package/vue3/lib/node/functions/evaluate/node-runtime/index.d.ts +1 -1
- package/vue3/lib/node/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/vue3/lib/node/functions/get-content/types.d.ts +94 -3
- package/vue3/lib/node/functions/is-node-runtime.d.ts +4 -0
- package/vue3/lib/node/{get-block-actions.12becb73.js → get-block-actions.65678660.js} +1 -1
- package/vue3/lib/{browser/get-block-actions.316f88d7.cjs → node/get-block-actions.977f70db.cjs} +1 -1
- package/vue3/lib/{browser/index.67caa0a0.js → node/index.1a21f267.js} +845 -718
- package/vue3/lib/node/index.baa2a660.cjs +109 -0
- package/vue3/lib/node/index.cjs +1 -1
- package/vue3/lib/node/index.js +27 -26
- package/vue3/lib/{browser/repeated-block.ab5e93b5.js → node/repeated-block.04f4039b.js} +5 -4
- package/vue3/lib/node/repeated-block.33e03818.cjs +1 -0
- package/vue3/lib/node/style.css +1 -1
- package/vue3/package.json +2 -0
- package/vue2/lib/browser/enable-editor-68f3b7d1.cjs +0 -1
- package/vue2/lib/browser/evaluate-81e9d18d.js +0 -81
- package/vue2/lib/browser/evaluate-c6468e7e.cjs +0 -1
- package/vue2/lib/browser/get-processed-block-5ea5ad51.js +0 -58
- package/vue2/lib/browser/index-4480d5e4.cjs +0 -32
- package/vue2/lib/edge/enable-editor-86cc8a4d.cjs +0 -1
- package/vue2/lib/edge/evaluate-16c456b4.cjs +0 -21
- package/vue2/lib/edge/index-df9193d2.cjs +0 -32
- package/vue2/lib/node/enable-editor-68f3b7d1.cjs +0 -1
- package/vue2/lib/node/evaluate-81e9d18d.js +0 -81
- package/vue2/lib/node/evaluate-c6468e7e.cjs +0 -1
- package/vue2/lib/node/get-processed-block-df5bc2af.cjs +0 -1
- package/vue2/lib/node/index-4480d5e4.cjs +0 -32
- package/vue3/lib/browser/index.2b9eb004.cjs +0 -69
- package/vue3/lib/edge/component-ref.40439a7f.cjs +0 -1
- package/vue3/lib/edge/index.db87480a.cjs +0 -89
- package/vue3/lib/node/block-wrapper.1501b793.cjs +0 -1
- package/vue3/lib/node/index.2b9eb004.cjs +0 -69
- package/vue3/lib/node/repeated-block.3a15e789.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as k } from "vue";
|
|
2
|
-
import { e as
|
|
3
|
-
import { r as
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
import { e as f } from "./evaluate-06bae117.js";
|
|
3
|
+
import { r as w, m as p, T as y, l as g, _ as b, o as S, p as _, i as h, f as E, q as I, t as U, u as M, v as H, n as P } from "./index-fe4f9482.js";
|
|
4
|
+
const T = "0.7.1-0", K = () => {
|
|
5
|
+
w("insertMenu", {
|
|
6
6
|
name: "_default",
|
|
7
7
|
default: !0,
|
|
8
8
|
items: [{
|
|
@@ -24,14 +24,14 @@ const H = "0.6.4", q = () => {
|
|
|
24
24
|
}]
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
let
|
|
28
|
-
const
|
|
27
|
+
let C = !1;
|
|
28
|
+
const q = (n = {}) => {
|
|
29
29
|
var e, t;
|
|
30
|
-
|
|
30
|
+
C || (C = !0, p() && ((e = window.parent) == null || e.postMessage({
|
|
31
31
|
type: "builder.sdkInfo",
|
|
32
32
|
data: {
|
|
33
33
|
target: y,
|
|
34
|
-
version:
|
|
34
|
+
version: T,
|
|
35
35
|
supportsPatchUpdates: !1,
|
|
36
36
|
// Supports builder-model="..." attribute which is needed to
|
|
37
37
|
// scope our '+ add block' button styling
|
|
@@ -50,33 +50,33 @@ const K = (n = {}) => {
|
|
|
50
50
|
if (i != null && i.type)
|
|
51
51
|
switch (i.type) {
|
|
52
52
|
case "builder.evaluate": {
|
|
53
|
-
const a = i.data.text,
|
|
53
|
+
const a = i.data.text, d = i.data.arguments || [], l = i.data.id, x = new Function(a);
|
|
54
54
|
let r, c = null;
|
|
55
55
|
try {
|
|
56
|
-
r =
|
|
57
|
-
} catch (
|
|
58
|
-
c =
|
|
56
|
+
r = x.apply(null, d);
|
|
57
|
+
} catch (u) {
|
|
58
|
+
c = u;
|
|
59
59
|
}
|
|
60
60
|
c ? (o = window.parent) == null || o.postMessage({
|
|
61
61
|
type: "builder.evaluateError",
|
|
62
62
|
data: {
|
|
63
|
-
id:
|
|
63
|
+
id: l,
|
|
64
64
|
error: c.message
|
|
65
65
|
}
|
|
66
|
-
}, "*") : r && typeof r.then == "function" ? r.then((
|
|
67
|
-
var
|
|
68
|
-
(
|
|
66
|
+
}, "*") : r && typeof r.then == "function" ? r.then((u) => {
|
|
67
|
+
var m;
|
|
68
|
+
(m = window.parent) == null || m.postMessage({
|
|
69
69
|
type: "builder.evaluateResult",
|
|
70
70
|
data: {
|
|
71
|
-
id:
|
|
72
|
-
result:
|
|
71
|
+
id: l,
|
|
72
|
+
result: u
|
|
73
73
|
}
|
|
74
74
|
}, "*");
|
|
75
75
|
}).catch(console.error) : (s = window.parent) == null || s.postMessage({
|
|
76
76
|
type: "builder.evaluateResult",
|
|
77
77
|
data: {
|
|
78
78
|
result: r,
|
|
79
|
-
id:
|
|
79
|
+
id: l
|
|
80
80
|
}
|
|
81
81
|
}, "*");
|
|
82
82
|
break;
|
|
@@ -84,7 +84,7 @@ const K = (n = {}) => {
|
|
|
84
84
|
}
|
|
85
85
|
})));
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function v(n) {
|
|
88
88
|
return Math.round(n * 1e3) / 1e3;
|
|
89
89
|
}
|
|
90
90
|
const O = (n, e, t = !0) => {
|
|
@@ -101,11 +101,11 @@ const O = (n, e, t = !0) => {
|
|
|
101
101
|
}, N = (n) => O(n, (e) => {
|
|
102
102
|
const t = e.getAttribute("builder-id") || e.id;
|
|
103
103
|
return (t == null ? void 0 : t.indexOf("builder-")) === 0;
|
|
104
|
-
}),
|
|
104
|
+
}), R = ({
|
|
105
105
|
event: n,
|
|
106
106
|
target: e
|
|
107
107
|
}) => {
|
|
108
|
-
const t = e.getBoundingClientRect(), i = n.clientX - t.left, o = n.clientY - t.top, s =
|
|
108
|
+
const t = e.getBoundingClientRect(), i = n.clientX - t.left, o = n.clientY - t.top, s = v(i / t.width), a = v(o / t.height);
|
|
109
109
|
return {
|
|
110
110
|
x: s,
|
|
111
111
|
y: a
|
|
@@ -115,11 +115,11 @@ const O = (n, e, t = !0) => {
|
|
|
115
115
|
return {
|
|
116
116
|
targetBuilderElement: i || void 0,
|
|
117
117
|
metadata: {
|
|
118
|
-
targetOffset: e ?
|
|
118
|
+
targetOffset: e ? R({
|
|
119
119
|
event: n,
|
|
120
120
|
target: e
|
|
121
121
|
}) : void 0,
|
|
122
|
-
builderTargetOffset: t ?
|
|
122
|
+
builderTargetOffset: t ? R({
|
|
123
123
|
event: n,
|
|
124
124
|
target: t
|
|
125
125
|
}) : void 0,
|
|
@@ -129,83 +129,59 @@ const O = (n, e, t = !0) => {
|
|
|
129
129
|
}, A = k({
|
|
130
130
|
name: "enable-editor",
|
|
131
131
|
props: [
|
|
132
|
-
"canTrack",
|
|
133
132
|
"builderContextSignal",
|
|
134
133
|
"model",
|
|
135
134
|
"context",
|
|
135
|
+
"canTrack",
|
|
136
136
|
"apiKey",
|
|
137
|
-
"showContent",
|
|
138
|
-
"classNameProp",
|
|
139
|
-
"content",
|
|
140
137
|
"locale",
|
|
141
138
|
"includeRefs",
|
|
142
|
-
"enrich"
|
|
139
|
+
"enrich",
|
|
140
|
+
"content",
|
|
141
|
+
"showContent",
|
|
142
|
+
"classNameProp"
|
|
143
143
|
],
|
|
144
144
|
data() {
|
|
145
145
|
return {
|
|
146
|
-
canTrackToUse: w(this.canTrack) ? this.canTrack : !0,
|
|
147
146
|
forceReRenderCount: 0,
|
|
148
147
|
lastUpdated: 0,
|
|
149
148
|
shouldSendResetCookie: !1,
|
|
150
149
|
httpReqsData: {},
|
|
151
150
|
clicked: !1,
|
|
152
|
-
builderContext:
|
|
151
|
+
builderContext: g
|
|
153
152
|
};
|
|
154
153
|
},
|
|
155
154
|
provide() {
|
|
156
155
|
const n = this;
|
|
157
156
|
return {
|
|
158
|
-
[
|
|
157
|
+
[g.key]: n.builderContextSignal
|
|
159
158
|
};
|
|
160
159
|
},
|
|
161
160
|
mounted() {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
this.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const i = E(t);
|
|
181
|
-
(o = window.parent) == null || o.postMessage(i, "*");
|
|
182
|
-
}), window.addEventListener(
|
|
183
|
-
"builder:component:stateChangeListenerActivated",
|
|
184
|
-
this.emitStateUpdate
|
|
185
|
-
)), this.builderContextSignal.content) {
|
|
186
|
-
const t = (n = this.builderContextSignal.content) == null ? void 0 : n.testVariationId, i = (e = this.builderContextSignal.content) == null ? void 0 : e.id;
|
|
187
|
-
g({
|
|
188
|
-
type: "impression",
|
|
189
|
-
canTrack: this.canTrackToUse,
|
|
190
|
-
contentId: i,
|
|
191
|
-
apiKey: this.apiKey,
|
|
192
|
-
variationId: t !== i ? t : void 0
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
if (U()) {
|
|
196
|
-
const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
|
|
197
|
-
`builder.preview.${i}`
|
|
198
|
-
), s = t.get("apiKey") || t.get("builder.space");
|
|
199
|
-
i === this.model && s === this.apiKey && (!this.content || o === this.content.id) && I({
|
|
200
|
-
model: this.model,
|
|
201
|
-
apiKey: this.apiKey,
|
|
202
|
-
apiVersion: this.builderContextSignal.apiVersion
|
|
203
|
-
}).then((a) => {
|
|
204
|
-
a && this.mergeNewContent(a);
|
|
205
|
-
});
|
|
161
|
+
(() => {
|
|
162
|
+
var t, i;
|
|
163
|
+
if (p()) {
|
|
164
|
+
if (h() && this.$refs.elementRef && this.$refs.elementRef.dispatchEvent(
|
|
165
|
+
new CustomEvent("initeditingbldr")
|
|
166
|
+
), this.builderContextSignal.content && S(this.canTrack)) {
|
|
167
|
+
const s = (t = this.builderContextSignal.content) == null ? void 0 : t.testVariationId, a = (i = this.builderContextSignal.content) == null ? void 0 : i.id, d = this.apiKey;
|
|
168
|
+
b({
|
|
169
|
+
type: "impression",
|
|
170
|
+
canTrack: !0,
|
|
171
|
+
contentId: a,
|
|
172
|
+
apiKey: d,
|
|
173
|
+
variationId: s !== a ? s : void 0
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
M() && this.$refs.elementRef && this.$refs.elementRef.dispatchEvent(
|
|
177
|
+
new CustomEvent("initpreviewingbldr")
|
|
178
|
+
);
|
|
206
179
|
}
|
|
207
|
-
|
|
208
|
-
|
|
180
|
+
})(), (() => {
|
|
181
|
+
this.apiKey || H.error(
|
|
182
|
+
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
183
|
+
), this.evaluateJsCode(), this.runHttpRequests(), this.emitStateUpdate();
|
|
184
|
+
})();
|
|
209
185
|
},
|
|
210
186
|
watch: {
|
|
211
187
|
onUpdateHook0: {
|
|
@@ -236,7 +212,7 @@ const O = (n, e, t = !0) => {
|
|
|
236
212
|
}
|
|
237
213
|
},
|
|
238
214
|
unmounted() {
|
|
239
|
-
|
|
215
|
+
p() && (window.removeEventListener("message", this.processMessage), window.removeEventListener(
|
|
240
216
|
"builder:component:stateChangeListenerActivated",
|
|
241
217
|
this.emitStateUpdate
|
|
242
218
|
));
|
|
@@ -315,7 +291,7 @@ const O = (n, e, t = !0) => {
|
|
|
315
291
|
evaluateJsCode() {
|
|
316
292
|
var e, t;
|
|
317
293
|
const n = (t = (e = this.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : t.jsCode;
|
|
318
|
-
n &&
|
|
294
|
+
n && f({
|
|
319
295
|
code: n,
|
|
320
296
|
context: this.context || {},
|
|
321
297
|
localState: void 0,
|
|
@@ -327,9 +303,9 @@ const O = (n, e, t = !0) => {
|
|
|
327
303
|
var e, t;
|
|
328
304
|
if (this.builderContextSignal.content) {
|
|
329
305
|
const i = (e = this.builderContextSignal.content) == null ? void 0 : e.testVariationId, o = (t = this.builderContextSignal.content) == null ? void 0 : t.id;
|
|
330
|
-
|
|
306
|
+
b({
|
|
331
307
|
type: "click",
|
|
332
|
-
canTrack: this.
|
|
308
|
+
canTrack: S(this.canTrack),
|
|
333
309
|
contentId: o,
|
|
334
310
|
apiKey: this.apiKey,
|
|
335
311
|
variationId: i !== o ? i : void 0,
|
|
@@ -342,7 +318,7 @@ const O = (n, e, t = !0) => {
|
|
|
342
318
|
evalExpression(n) {
|
|
343
319
|
return n.replace(
|
|
344
320
|
/{{([^}]+)}}/g,
|
|
345
|
-
(e, t) =>
|
|
321
|
+
(e, t) => f({
|
|
346
322
|
code: t,
|
|
347
323
|
context: this.context || {},
|
|
348
324
|
localState: void 0,
|
|
@@ -352,7 +328,7 @@ const O = (n, e, t = !0) => {
|
|
|
352
328
|
);
|
|
353
329
|
},
|
|
354
330
|
handleRequest({ url: n, key: e }) {
|
|
355
|
-
|
|
331
|
+
_(n).then((t) => t.json()).then((t) => {
|
|
356
332
|
var o, s;
|
|
357
333
|
const i = {
|
|
358
334
|
...this.builderContextSignal.rootState,
|
|
@@ -367,7 +343,7 @@ const O = (n, e, t = !0) => {
|
|
|
367
343
|
var e, t;
|
|
368
344
|
const n = ((t = (e = this.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : t.httpRequests) ?? {};
|
|
369
345
|
Object.entries(n).forEach(([i, o]) => {
|
|
370
|
-
if (o && (!this.httpReqsData[i] ||
|
|
346
|
+
if (o && (!this.httpReqsData[i] || h())) {
|
|
371
347
|
const s = this.evalExpression(o);
|
|
372
348
|
this.handleRequest({
|
|
373
349
|
url: s,
|
|
@@ -377,12 +353,12 @@ const O = (n, e, t = !0) => {
|
|
|
377
353
|
});
|
|
378
354
|
},
|
|
379
355
|
emitStateUpdate() {
|
|
380
|
-
|
|
356
|
+
h() && window.dispatchEvent(
|
|
381
357
|
new CustomEvent(
|
|
382
358
|
"builder:component:stateChange",
|
|
383
359
|
{
|
|
384
360
|
detail: {
|
|
385
|
-
state:
|
|
361
|
+
state: E(this.builderContextSignal.rootState),
|
|
386
362
|
ref: {
|
|
387
363
|
name: this.model
|
|
388
364
|
}
|
|
@@ -391,6 +367,40 @@ const O = (n, e, t = !0) => {
|
|
|
391
367
|
)
|
|
392
368
|
);
|
|
393
369
|
},
|
|
370
|
+
elementRef_onIniteditingbldr(n) {
|
|
371
|
+
this.forceReRenderCount = this.forceReRenderCount + 1, window.addEventListener("message", this.processMessage), K(), q({
|
|
372
|
+
...this.locale ? {
|
|
373
|
+
locale: this.locale
|
|
374
|
+
} : {},
|
|
375
|
+
...this.includeRefs ? {
|
|
376
|
+
includeRefs: this.includeRefs
|
|
377
|
+
} : {},
|
|
378
|
+
...this.enrich ? {
|
|
379
|
+
enrich: this.enrich
|
|
380
|
+
} : {}
|
|
381
|
+
}), Object.values(
|
|
382
|
+
this.builderContextSignal.componentInfos
|
|
383
|
+
).forEach((e) => {
|
|
384
|
+
var i;
|
|
385
|
+
const t = I(e);
|
|
386
|
+
(i = window.parent) == null || i.postMessage(t, "*");
|
|
387
|
+
}), window.addEventListener(
|
|
388
|
+
"builder:component:stateChangeListenerActivated",
|
|
389
|
+
this.emitStateUpdate
|
|
390
|
+
);
|
|
391
|
+
},
|
|
392
|
+
elementRef_onInitpreviewingbldr(n) {
|
|
393
|
+
const e = new URL(location.href).searchParams, t = e.get("builder.preview"), i = e.get(
|
|
394
|
+
`builder.preview.${t}`
|
|
395
|
+
), o = e.get("apiKey") || e.get("builder.space");
|
|
396
|
+
t === this.model && o === this.apiKey && (!this.content || i === this.content.id) && U({
|
|
397
|
+
model: this.model,
|
|
398
|
+
apiKey: this.apiKey,
|
|
399
|
+
apiVersion: this.builderContextSignal.apiVersion
|
|
400
|
+
}).then((s) => {
|
|
401
|
+
s && this.mergeNewContent(s);
|
|
402
|
+
});
|
|
403
|
+
},
|
|
394
404
|
_classStringToObject(n) {
|
|
395
405
|
const e = {};
|
|
396
406
|
if (typeof n != "string")
|
|
@@ -407,13 +417,17 @@ var L = function() {
|
|
|
407
417
|
var e = this, t = e._self._c;
|
|
408
418
|
return e._self._setupProxy, e.builderContextSignal.content ? t("div", e._b({ key: e.forceReRenderCount, ref: "elementRef", class: e._classStringToObject(e.classNameProp), attrs: { "builder-content-id": (i = e.builderContextSignal.content) == null ? void 0 : i.id, "builder-model": e.model }, on: { click: function(o) {
|
|
409
419
|
return e.onClick(o);
|
|
420
|
+
}, initeditingbldr: function(o) {
|
|
421
|
+
return e.elementRef_onIniteditingbldr(o);
|
|
422
|
+
}, initpreviewingbldr: function(o) {
|
|
423
|
+
return e.elementRef_onInitpreviewingbldr(o);
|
|
410
424
|
} } }, "div", {
|
|
411
425
|
...e.showContent ? {} : {
|
|
412
426
|
hidden: !0,
|
|
413
427
|
"aria-hidden": !0
|
|
414
428
|
}
|
|
415
429
|
}, !1), [e._t("default")], 2) : e._e();
|
|
416
|
-
}, B = [], D = /* @__PURE__ */
|
|
430
|
+
}, B = [], D = /* @__PURE__ */ P(
|
|
417
431
|
A,
|
|
418
432
|
L,
|
|
419
433
|
B,
|
|
@@ -423,7 +437,7 @@ var L = function() {
|
|
|
423
437
|
null,
|
|
424
438
|
null
|
|
425
439
|
);
|
|
426
|
-
const
|
|
440
|
+
const J = D.exports;
|
|
427
441
|
export {
|
|
428
|
-
|
|
442
|
+
J as default
|
|
429
443
|
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { i as isEditing, m as isBrowser, w as getUserAttributes, f as fastClone, v as logger } from "./index-fe4f9482.js";
|
|
2
|
+
const getFunctionArguments = ({
|
|
3
|
+
builder: e,
|
|
4
|
+
context: t,
|
|
5
|
+
event: s,
|
|
6
|
+
state: n
|
|
7
|
+
}) => Object.entries({
|
|
8
|
+
state: n,
|
|
9
|
+
Builder: e,
|
|
10
|
+
// legacy
|
|
11
|
+
builder: e,
|
|
12
|
+
context: t,
|
|
13
|
+
event: s
|
|
14
|
+
}), getBuilderGlobals = () => ({
|
|
15
|
+
isEditing: isEditing(),
|
|
16
|
+
isBrowser: isBrowser(),
|
|
17
|
+
isServer: !isBrowser(),
|
|
18
|
+
getUserAttributes: () => getUserAttributes()
|
|
19
|
+
}), parseCode = (e, {
|
|
20
|
+
isExpression: t = !0
|
|
21
|
+
}) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, runInBrowser = ({
|
|
22
|
+
code: e,
|
|
23
|
+
builder: t,
|
|
24
|
+
context: s,
|
|
25
|
+
event: n,
|
|
26
|
+
localState: r,
|
|
27
|
+
rootSetState: o,
|
|
28
|
+
rootState: u
|
|
29
|
+
}) => {
|
|
30
|
+
const l = getFunctionArguments({
|
|
31
|
+
builder: t,
|
|
32
|
+
context: s,
|
|
33
|
+
event: n,
|
|
34
|
+
state: flattenState(u, r, o)
|
|
35
|
+
});
|
|
36
|
+
return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
|
|
37
|
+
};
|
|
38
|
+
function flattenState(e, t, s) {
|
|
39
|
+
if (e === t)
|
|
40
|
+
throw new Error("rootState === localState");
|
|
41
|
+
return new Proxy(e, {
|
|
42
|
+
get: (n, r) => t && r in t ? t[r] : e[r],
|
|
43
|
+
set: (n, r, o) => {
|
|
44
|
+
if (t && r in t)
|
|
45
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
46
|
+
return e[r] = o, s == null || s(e), !0;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const noop = () => null;
|
|
51
|
+
let safeDynamicRequire = noop;
|
|
52
|
+
try {
|
|
53
|
+
safeDynamicRequire = eval("require");
|
|
54
|
+
} catch (e) {
|
|
55
|
+
}
|
|
56
|
+
const set = (e, t, s) => {
|
|
57
|
+
if (Object(e) !== e)
|
|
58
|
+
return e;
|
|
59
|
+
const n = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
60
|
+
return n.slice(0, -1).reduce((r, o, u) => Object(r[o]) === r[o] ? r[o] : r[o] = Math.abs(Number(n[u + 1])) >> 0 === +n[u + 1] ? [] : {}, e)[n[n.length - 1]] = s, e;
|
|
61
|
+
}, ivm = safeDynamicRequire("isolated-vm"), getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
|
|
62
|
+
var refToProxy = (obj) => {
|
|
63
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
64
|
+
return obj;
|
|
65
|
+
}
|
|
66
|
+
return new Proxy({}, {
|
|
67
|
+
get(target, key) {
|
|
68
|
+
if (key === 'copySync') {
|
|
69
|
+
return () => obj.copySync();
|
|
70
|
+
}
|
|
71
|
+
const val = obj.getSync(key);
|
|
72
|
+
if (typeof val?.getSync === 'function') {
|
|
73
|
+
return refToProxy(val);
|
|
74
|
+
}
|
|
75
|
+
return val;
|
|
76
|
+
},
|
|
77
|
+
set(target, key, value) {
|
|
78
|
+
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
79
|
+
obj.setSync(key, v);
|
|
80
|
+
${BUILDER_SET_STATE_NAME}(key, value)
|
|
81
|
+
},
|
|
82
|
+
deleteProperty(target, key) {
|
|
83
|
+
obj.deleteSync(key);
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
`, processCode = ({
|
|
88
|
+
code: e,
|
|
89
|
+
args: t
|
|
90
|
+
}) => {
|
|
91
|
+
const s = t.map(([n]) => `var ${n} = refToProxy(${getSyncValName(n)}); `).join("");
|
|
92
|
+
return `
|
|
93
|
+
${REF_TO_PROXY_FN}
|
|
94
|
+
${s}
|
|
95
|
+
function theFunction() {
|
|
96
|
+
${e}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let output = theFunction()
|
|
100
|
+
|
|
101
|
+
if (typeof output === 'object' && output !== null) {
|
|
102
|
+
output = JSON.stringify(output.copySync ? output.copySync() : output);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
output;
|
|
106
|
+
`;
|
|
107
|
+
}, getIsolateContext = () => new ivm.Isolate({
|
|
108
|
+
memoryLimit: 128
|
|
109
|
+
}).createContextSync(), runInNode = ({
|
|
110
|
+
code: e,
|
|
111
|
+
builder: t,
|
|
112
|
+
context: s,
|
|
113
|
+
event: n,
|
|
114
|
+
localState: r,
|
|
115
|
+
rootSetState: o,
|
|
116
|
+
rootState: u
|
|
117
|
+
}) => {
|
|
118
|
+
const l = fastClone({
|
|
119
|
+
...u,
|
|
120
|
+
...r
|
|
121
|
+
}), c = getFunctionArguments({
|
|
122
|
+
builder: t,
|
|
123
|
+
context: s,
|
|
124
|
+
event: n,
|
|
125
|
+
state: l
|
|
126
|
+
}), g = getIsolateContext(), a = g.global;
|
|
127
|
+
a.setSync("global", a.derefInto()), a.setSync("log", function(...i) {
|
|
128
|
+
console.log(...i);
|
|
129
|
+
}), a.setSync(BUILDER_SET_STATE_NAME, function(i, y) {
|
|
130
|
+
set(u, i, y), o == null || o(u);
|
|
131
|
+
}), c.forEach(([i, y]) => {
|
|
132
|
+
const E = typeof y == "object" ? new ivm.Reference(
|
|
133
|
+
// workaround: methods with default values for arguments is not being cloned over
|
|
134
|
+
i === "builder" ? {
|
|
135
|
+
...y,
|
|
136
|
+
getUserAttributes: () => y.getUserAttributes()
|
|
137
|
+
} : y
|
|
138
|
+
) : null;
|
|
139
|
+
a.setSync(getSyncValName(i), E);
|
|
140
|
+
}), a.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
141
|
+
const v = processCode({
|
|
142
|
+
code: e,
|
|
143
|
+
args: c
|
|
144
|
+
}), f = g.evalSync(v);
|
|
145
|
+
try {
|
|
146
|
+
return JSON.parse(f);
|
|
147
|
+
} catch {
|
|
148
|
+
return f;
|
|
149
|
+
}
|
|
150
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
|
|
151
|
+
function evaluate({
|
|
152
|
+
code: e,
|
|
153
|
+
context: t,
|
|
154
|
+
localState: s,
|
|
155
|
+
rootState: n,
|
|
156
|
+
rootSetState: r,
|
|
157
|
+
event: o,
|
|
158
|
+
isExpression: u = !0
|
|
159
|
+
}) {
|
|
160
|
+
if (e === "") {
|
|
161
|
+
logger.warn("Skipping evaluation of empty code block.");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const l = {
|
|
165
|
+
code: parseCode(e, {
|
|
166
|
+
isExpression: u
|
|
167
|
+
}),
|
|
168
|
+
builder: getBuilderGlobals(),
|
|
169
|
+
context: t,
|
|
170
|
+
event: o,
|
|
171
|
+
rootSetState: r,
|
|
172
|
+
rootState: n,
|
|
173
|
+
localState: s
|
|
174
|
+
};
|
|
175
|
+
try {
|
|
176
|
+
return chooseBrowserOrServerEval(l);
|
|
177
|
+
} catch (c) {
|
|
178
|
+
logger.error("Failed code evaluation: " + c.message, {
|
|
179
|
+
code: e
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
export {
|
|
185
|
+
evaluate as e,
|
|
186
|
+
set as s
|
|
187
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";const index=require("./index-55b86b2c.cjs"),getFunctionArguments=({builder:e,context:t,event:s,state:n})=>Object.entries({state:n,Builder:e,builder:e,context:t,event:s}),getBuilderGlobals=()=>({isEditing:index.isEditing(),isBrowser:index.isBrowser(),isServer:!index.isBrowser(),getUserAttributes:()=>index.getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:s,event:n,localState:r,rootSetState:o,rootState:u})=>{const l=getFunctionArguments({builder:t,context:s,event:n,state:flattenState(u,r,o)});return new Function(...l.map(([i])=>i),e)(...l.map(([,i])=>i))};function flattenState(e,t,s){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(n,r)=>t&&r in t?t[r]:e[r],set:(n,r,o)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[r]=o,s==null||s(e),!0}})}const noop=()=>null;let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const set=(e,t,s)=>{if(Object(e)!==e)return e;const n=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return n.slice(0,-1).reduce((r,o,u)=>Object(r[o])===r[o]?r[o]:r[o]=Math.abs(Number(n[u+1]))>>0===+n[u+1]?[]:{},e)[n[n.length-1]]=s,e},ivm=safeDynamicRequire("isolated-vm"),getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
|
+
var refToProxy = (obj) => {
|
|
3
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
4
|
+
return obj;
|
|
5
|
+
}
|
|
6
|
+
return new Proxy({}, {
|
|
7
|
+
get(target, key) {
|
|
8
|
+
if (key === 'copySync') {
|
|
9
|
+
return () => obj.copySync();
|
|
10
|
+
}
|
|
11
|
+
const val = obj.getSync(key);
|
|
12
|
+
if (typeof val?.getSync === 'function') {
|
|
13
|
+
return refToProxy(val);
|
|
14
|
+
}
|
|
15
|
+
return val;
|
|
16
|
+
},
|
|
17
|
+
set(target, key, value) {
|
|
18
|
+
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
19
|
+
obj.setSync(key, v);
|
|
20
|
+
${BUILDER_SET_STATE_NAME}(key, value)
|
|
21
|
+
},
|
|
22
|
+
deleteProperty(target, key) {
|
|
23
|
+
obj.deleteSync(key);
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
`,processCode=({code:e,args:t})=>{const s=t.map(([n])=>`var ${n} = refToProxy(${getSyncValName(n)}); `).join("");return`
|
|
28
|
+
${REF_TO_PROXY_FN}
|
|
29
|
+
${s}
|
|
30
|
+
function theFunction() {
|
|
31
|
+
${e}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let output = theFunction()
|
|
35
|
+
|
|
36
|
+
if (typeof output === 'object' && output !== null) {
|
|
37
|
+
output = JSON.stringify(output.copySync ? output.copySync() : output);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
output;
|
|
41
|
+
`},getIsolateContext=()=>new ivm.Isolate({memoryLimit:128}).createContextSync(),runInNode=({code:e,builder:t,context:s,event:n,localState:r,rootSetState:o,rootState:u})=>{const l=index.fastClone({...u,...r}),i=getFunctionArguments({builder:t,context:s,event:n,state:l}),g=getIsolateContext(),a=g.global;a.setSync("global",a.derefInto()),a.setSync("log",function(...c){console.log(...c)}),a.setSync(BUILDER_SET_STATE_NAME,function(c,y){set(u,c,y),o==null||o(u)}),i.forEach(([c,y])=>{const d=typeof y=="object"?new ivm.Reference(c==="builder"?{...y,getUserAttributes:()=>y.getUserAttributes()}:y):null;a.setSync(getSyncValName(c),d)}),a.setSync(INJECTED_IVM_GLOBAL,ivm);const v=processCode({code:e,args:i}),f=g.evalSync(v);try{return JSON.parse(f)}catch{return f}},chooseBrowserOrServerEval=e=>index.isBrowser()?runInBrowser(e):runInNode(e);function evaluate({code:e,context:t,localState:s,rootState:n,rootSetState:r,event:o,isExpression:u=!0}){if(e===""){index.logger.warn("Skipping evaluation of empty code block.");return}const l={code:parseCode(e,{isExpression:u}),builder:getBuilderGlobals(),context:t,event:o,rootSetState:r,rootState:n,localState:s};try{return chooseBrowserOrServerEval(l)}catch(i){index.logger.error("Failed code evaluation: "+i.message,{code:e});return}}exports.evaluate=evaluate;exports.set=set;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExecutorArgs } from './helpers.js';
|
|
2
|
+
/**
|
|
3
|
+
* Even though we have separate runtimes for browser/node/edge, sometimes frameworks will
|
|
4
|
+
* end up sending the server runtime code to the browser (most notably in dev mode).
|
|
5
|
+
*/
|
|
6
|
+
export declare const chooseBrowserOrServerEval: (args: ExecutorArgs) => any;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
|
|
3
|
-
event?: Event;
|
|
4
|
-
isExpression?: boolean;
|
|
5
|
-
};
|
|
1
|
+
import type { EvaluatorArgs } from './helpers.js';
|
|
6
2
|
export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression }: EvaluatorArgs): any;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { BuilderContextInterface, BuilderRenderState } from '../../context/types.js';
|
|
2
|
-
import
|
|
2
|
+
import { getUserAttributes } from '../track/helpers.js';
|
|
3
|
+
export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
|
|
4
|
+
event?: Event;
|
|
5
|
+
isExpression?: boolean;
|
|
6
|
+
};
|
|
3
7
|
export type BuilderGlobals = {
|
|
4
8
|
isEditing: boolean | undefined;
|
|
5
9
|
isBrowser: boolean | undefined;
|
|
@@ -16,3 +20,5 @@ export type FunctionArguments = ReturnType<typeof getFunctionArguments>;
|
|
|
16
20
|
export declare const getFunctionArguments: ({ builder, context, event, state }: Pick<ExecutorArgs, "context" | "builder" | "event"> & {
|
|
17
21
|
state: BuilderRenderState;
|
|
18
22
|
}) => any;
|
|
23
|
+
export declare const getBuilderGlobals: () => BuilderGlobals;
|
|
24
|
+
export declare const parseCode: (code: string, { isExpression }: Pick<EvaluatorArgs, 'isExpression'>) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { evaluator } from '
|
|
1
|
+
export { runInNode as evaluator } from './node-runtime.js';
|