@builder.io/sdk-vue 0.0.1-9 → 0.0.1

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +44 -0
  3. package/dist/vue-2/block-styles.3f130795.js +67 -0
  4. package/dist/vue-2/block-styles.da610cf5.cjs +10 -0
  5. package/dist/vue-2/get-processed-block.2bcd0d2b.cjs +1 -0
  6. package/dist/vue-2/get-processed-block.c01e4ddc.js +44 -0
  7. package/dist/vue-2/index.0622ae10.js +1996 -0
  8. package/dist/vue-2/index.dcdf302c.cjs +4 -0
  9. package/dist/vue-2/render-block.bdaa8069.js +243 -0
  10. package/dist/vue-2/render-block.f41ce0b2.cjs +3 -0
  11. package/dist/vue-2/render-inlined-styles.7974da9f.js +31 -0
  12. package/dist/vue-2/render-inlined-styles.b3a06398.cjs +1 -0
  13. package/dist/vue-2/render-repeated-block.c2b982e3.js +45 -0
  14. package/dist/vue-2/render-repeated-block.f36a831f.cjs +1 -0
  15. package/dist/vue-2/render-styles.354823a4.js +65 -0
  16. package/dist/vue-2/render-styles.4b5b2368.cjs +17 -0
  17. package/dist/vue-2/sdk.cjs +1 -0
  18. package/dist/vue-2/sdk.js +27 -0
  19. package/dist/vue-2/style.css +1 -0
  20. package/dist/vue-3/block-styles.76754b24.js +64 -0
  21. package/dist/vue-3/block-styles.e17850cc.cjs +10 -0
  22. package/dist/vue-3/get-processed-block.2dd25223.cjs +1 -0
  23. package/dist/vue-3/get-processed-block.6eaca128.js +44 -0
  24. package/dist/vue-3/index.3e132178.js +78896 -0
  25. package/dist/vue-3/index.475f52c7.cjs +1 -0
  26. package/dist/vue-3/index.52915610.js +1969 -0
  27. package/dist/vue-3/index.91387fc2.cjs +4 -0
  28. package/dist/vue-3/render-block.369b7818.js +255 -0
  29. package/dist/vue-3/render-block.c9718d52.cjs +3 -0
  30. package/dist/vue-3/render-inlined-styles.2a3eeef4.cjs +1 -0
  31. package/dist/vue-3/render-inlined-styles.af201a11.js +30 -0
  32. package/dist/vue-3/render-repeated-block.4266e559.js +40 -0
  33. package/dist/vue-3/render-repeated-block.b4a6d591.cjs +1 -0
  34. package/dist/vue-3/render-styles.1744d2eb.js +59 -0
  35. package/dist/vue-3/render-styles.7d5898dd.cjs +17 -0
  36. package/dist/vue-3/sdk.cjs +1 -0
  37. package/dist/vue-3/sdk.js +28 -0
  38. package/dist/vue-3/style.css +1 -0
  39. package/nuxt.js +25 -0
  40. package/package.json +38 -5
  41. package/src/blocks/button.js +0 -31
  42. package/src/blocks/button.original.vue +0 -48
  43. package/src/blocks/button_script.js +0 -21
  44. package/src/blocks/button_styles.js +0 -0
  45. package/src/blocks/columns.js +0 -31
  46. package/src/blocks/columns.original.vue +0 -59
  47. package/src/blocks/columns_script.js +0 -58
  48. package/src/blocks/columns_styles.js +0 -14
  49. package/src/blocks/custom-code.js +0 -31
  50. package/src/blocks/custom-code.original.vue +0 -72
  51. package/src/blocks/custom-code_script.js +0 -63
  52. package/src/blocks/custom-code_styles.js +0 -0
  53. package/src/blocks/embed.js +0 -31
  54. package/src/blocks/embed.original.vue +0 -64
  55. package/src/blocks/embed_script.js +0 -53
  56. package/src/blocks/embed_styles.js +0 -0
  57. package/src/blocks/form.js +0 -31
  58. package/src/blocks/form.original.vue +0 -289
  59. package/src/blocks/form_script.js +0 -231
  60. package/src/blocks/form_styles.js +0 -12
  61. package/src/blocks/fragment.js +0 -31
  62. package/src/blocks/fragment.original.vue +0 -28
  63. package/src/blocks/fragment_script.js +0 -40
  64. package/src/blocks/fragment_styles.js +0 -0
  65. package/src/blocks/image.js +0 -31
  66. package/src/blocks/image.original.vue +0 -52
  67. package/src/blocks/image_script.js +0 -32
  68. package/src/blocks/image_styles.js +0 -13
  69. package/src/blocks/img.js +0 -31
  70. package/src/blocks/img.original.vue +0 -31
  71. package/src/blocks/img_script.js +0 -42
  72. package/src/blocks/img_styles.js +0 -0
  73. package/src/blocks/input.js +0 -31
  74. package/src/blocks/input.original.vue +0 -28
  75. package/src/blocks/input_script.js +0 -39
  76. package/src/blocks/input_styles.js +0 -0
  77. package/src/blocks/raw-text.js +0 -31
  78. package/src/blocks/raw-text.original.vue +0 -35
  79. package/src/blocks/raw-text_script.js +0 -32
  80. package/src/blocks/raw-text_styles.js +0 -0
  81. package/src/blocks/section.js +0 -31
  82. package/src/blocks/section.original.vue +0 -29
  83. package/src/blocks/section_script.js +0 -23
  84. package/src/blocks/section_styles.js +0 -0
  85. package/src/blocks/select.js +0 -31
  86. package/src/blocks/select.original.vue +0 -32
  87. package/src/blocks/select_script.js +0 -41
  88. package/src/blocks/select_styles.js +0 -0
  89. package/src/blocks/submit-button.js +0 -31
  90. package/src/blocks/submit-button.original.vue +0 -27
  91. package/src/blocks/submit-button_script.js +0 -21
  92. package/src/blocks/submit-button_styles.js +0 -0
  93. package/src/blocks/symbol.js +0 -29
  94. package/src/blocks/symbol.original.vue +0 -33
  95. package/src/blocks/symbol_script.js +0 -44
  96. package/src/blocks/symbol_styles.js +0 -0
  97. package/src/blocks/text.js +0 -31
  98. package/src/blocks/text.original.vue +0 -25
  99. package/src/blocks/text_script.js +0 -21
  100. package/src/blocks/text_styles.js +0 -0
  101. package/src/blocks/textarea.js +0 -31
  102. package/src/blocks/textarea.original.vue +0 -25
  103. package/src/blocks/textarea_script.js +0 -21
  104. package/src/blocks/textarea_styles.js +0 -0
  105. package/src/blocks/video.js +0 -31
  106. package/src/blocks/video.original.vue +0 -34
  107. package/src/blocks/video_script.js +0 -28
  108. package/src/blocks/video_styles.js +0 -0
  109. package/src/components/block-styles.js +0 -29
  110. package/src/components/block-styles.original.vue +0 -25
  111. package/src/components/block-styles.vue +0 -34
  112. package/src/components/block-styles_script.js +0 -20
  113. package/src/components/block-styles_styles.js +0 -0
  114. package/src/components/error-boundary.js +0 -29
  115. package/src/components/error-boundary.original.vue +0 -25
  116. package/src/components/error-boundary.vue +0 -15
  117. package/src/components/error-boundary_script.js +0 -20
  118. package/src/components/error-boundary_styles.js +0 -0
  119. package/src/components/render-block.js +0 -29
  120. package/src/components/render-block.original.vue +0 -119
  121. package/src/components/render-block_script.js +0 -91
  122. package/src/components/render-block_styles.js +0 -0
  123. package/src/components/render-blocks.js +0 -29
  124. package/src/components/render-blocks.original.vue +0 -75
  125. package/src/components/render-blocks_script.js +0 -76
  126. package/src/components/render-blocks_styles.js +0 -12
  127. package/src/components/render-content.js +0 -29
  128. package/src/components/render-content.original.vue +0 -95
  129. package/src/components/render-content_script.js +0 -92
  130. package/src/components/render-content_styles.js +0 -0
  131. package/src/constants/device-sizes.js +0 -46
  132. package/src/context/builder.context.js +0 -11
  133. package/src/functions/evaluate.js +0 -42
  134. package/src/functions/get-block-actions.js +0 -45
  135. package/src/functions/get-block-component-options.js +0 -14
  136. package/src/functions/get-block-properties.js +0 -46
  137. package/src/functions/get-block-styles.js +0 -13
  138. package/src/functions/get-block-tag.js +0 -13
  139. package/src/functions/get-content.js +0 -123
  140. package/src/functions/get-processed-block.js +0 -65
  141. package/src/functions/get-processed-block.test.js +0 -44
  142. package/src/functions/get-target.js +0 -13
  143. package/src/functions/if-target.js +0 -13
  144. package/src/functions/is-browser.js +0 -30
  145. package/src/functions/is-editing.js +0 -30
  146. package/src/functions/is-iframe.js +0 -30
  147. package/src/functions/is-react-native.js +0 -13
  148. package/src/functions/macro-eval.js +0 -12
  149. package/src/functions/on-change.js +0 -34
  150. package/src/functions/on-change.test.js +0 -38
  151. package/src/functions/register-component.js +0 -73
  152. package/src/functions/register.js +0 -52
  153. package/src/functions/set-editor-settings.js +0 -38
  154. package/src/functions/set.js +0 -18
  155. package/src/functions/set.test.js +0 -35
  156. package/src/functions/track.js +0 -41
  157. package/src/index.js +0 -51
  158. package/src/scripts/init-editing.js +0 -78
  159. package/src/types/builder-block.js +0 -3
  160. package/src/types/builder-content.js +0 -3
  161. package/src/types/deep-partial.js +0 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ ### 0.0.1-56
2
+
3
+ - Feature: We now provide initial support for Vue 3.
4
+
5
+ 🧨 Breaking change: you must now explicitly import the Vue SDK version that you want (for Vue 2 or Vue 3) e.g.
6
+
7
+ ```ts
8
+ // imports Vue 2 SDK
9
+ import * as BuilderSDK from '@builder.io/sdk-vue/vue2';
10
+ // fallback to Vue 2 SDK
11
+ import * as BuilderSDK from '@builder.io/sdk-vue';
12
+
13
+ // imports Vue 3 SDK
14
+ import * as BuilderSDK from '@builder.io/sdk-vue/vue3';
15
+ ```
16
+
17
+ ### 0.0.1-54
18
+
19
+ 🐛 Fix: custom components were not rendering correctly
20
+ 🐛 Fix: Image component's `srcSet` was not being set correctly
21
+
22
+ ### 0.0.1-52
23
+
24
+ 🧨 Breaking change: the format of the `customComponents` prop has changed from `[{ component, info }]` to `[{ component, ...info }]`.
25
+ See [builder-registered-components.ts](/packages/sdks/src/constants/builder-registered-components.ts) for examples of how to do so, or see the example provided for this SDK.
26
+
27
+ ### 0.0.1-51
28
+
29
+ ⚠️ Deprecation notice: Registering components via `registerComponent(component, info)` is now deprecated.
30
+ To register your custom components in Builder, you must now provide a `customComponents` array to the `RenderContent` component containing `[{ component, info }]`.
31
+ See [builder-registered-components.ts](/packages/sdks/src/constants/builder-registered-components.ts) for examples of how to do so, or see the example provided for this SDK.
32
+
33
+ ### 0.0.1-50
34
+
35
+ - feat: 🎸 export `isPreviewing()` (https://github.com/BuilderIO/builder/pull/951)
36
+ - feat: 🎸 Add support for Symbols (https://github.com/BuilderIO/builder/pull/951)
37
+ - feat: 🎸 Add support for Data Bindings https://github.com/BuilderIO/builder/pull/970
38
+
39
+ - BREAKING CHANGE: 🧨 RenderContent must now be provided the `apiKey` as a prop (https://github.com/BuilderIO/builder/pull/951)
40
+
41
+ ### 0.0.1-49
42
+
43
+ - Fix: show the "+ add block" button on empty pages https://github.com/BuilderIO/builder/pull/934
44
+ - Add `getBuilderSearchParams` helper export to easily view current drafts on your production site. https://github.com/BuilderIO/builder/pull/883
45
+
46
+ ### 0.0.1-48
47
+
48
+ Changes:
49
+
50
+ - Adds support for Columns https://github.com/BuilderIO/builder/pull/717
51
+ - Add preliminary support for Children within custom components https://github.com/BuilderIO/builder/pull/753
52
+ - Seeds classnames to reduce variation in changes https://github.com/BuilderIO/builder/pull/703
53
+ - Fixes `getAllContent` to traverse all symbols/references https://github.com/BuilderIO/builder/pull/718
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # Builder.io Vue 2.0 SDK (BETA)
2
+
3
+ This is the 2.0 Vue SDK. It is currently in beta.
4
+
5
+ NOTE: If you are looking for the stable 1.0 Vue SDK, you can find it [here](/packages/vue)
6
+
7
+ ## Mitosis
8
+
9
+ This SDK is generated by [Mitosis](https://github.com/BuilderIO/mitosis). To see the Mitosis source-code, go [here](../../).
10
+
11
+ ## Feature Support
12
+
13
+ To check the status of the SDK, look at [these tables](../../README.md#feature-implementation).
14
+
15
+ ## Version Support
16
+
17
+ Legend:
18
+
19
+ - ✅: implemented
20
+ - 🏗: currently in progress
21
+ - ⚠️: not-yet implemented
22
+ - N/A : does not apply
23
+
24
+ | Platform | Support |
25
+ | -------- | ------- |
26
+ | Vue 2 | 🏗 |
27
+ | Nuxt 2 | 🏗 |
28
+ | Vue 3 | 🏗 |
29
+ | Nuxt 3 | ✅ |
30
+
31
+ ## Getting Started
32
+
33
+ ```
34
+ npm install @builder.io/sdk-vue@dev
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ You can see examples of using Builder.io:
40
+
41
+ - with Vue 2 [here](/examples/vue/vue-2/)
42
+ - with Nuxt 2 [here](/examples/vue/nuxt-2/)
43
+ - with Vue Storefront 2 [here](/examples/vue/vue-storefront-2)
44
+ - with Vue 3 [here](/examples/vue/vue-3/)
@@ -0,0 +1,67 @@
1
+ import { n as r, T as c } from "./index.0622ae10.js";
2
+ import { g as a } from "./get-processed-block.c01e4ddc.js";
3
+ const i = {
4
+ small: {
5
+ min: 320,
6
+ default: 321,
7
+ max: 640
8
+ },
9
+ medium: {
10
+ min: 641,
11
+ default: 642,
12
+ max: 991
13
+ },
14
+ large: {
15
+ min: 990,
16
+ default: 991,
17
+ max: 1200
18
+ }
19
+ }, l = (e) => `@media (max-width: ${i[e].max}px)`, m = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), o = (e) => Object.entries(e).map(([s, n]) => {
20
+ if (typeof n == "string")
21
+ return `${m(s)}: ${n};`;
22
+ }).join(`
23
+ `), u = () => import("./render-inlined-styles.7974da9f.js").then((e) => e.default), d = {
24
+ name: "block-styles",
25
+ components: { "render-inlined-styles": u },
26
+ props: ["block", "context"],
27
+ data: () => ({ TARGET: c }),
28
+ computed: {
29
+ useBlock() {
30
+ return a({
31
+ block: this.block,
32
+ state: this.context.state,
33
+ context: this.context.context,
34
+ shouldEvaluateBindings: !0
35
+ });
36
+ },
37
+ css() {
38
+ const e = this.useBlock.responsiveStyles, t = e == null ? void 0 : e.large, s = e == null ? void 0 : e.medium, n = e == null ? void 0 : e.small;
39
+ return `
40
+ ${t ? `.${this.useBlock.id} {${o(t)}}` : ""}
41
+ ${s ? `${l("medium")} {
42
+ .${this.useBlock.id} {${o(s)}}
43
+ }` : ""}
44
+ ${n ? `${l("small")} {
45
+ .${this.useBlock.id} {${o(n)}}
46
+ }` : ""}
47
+ }`;
48
+ }
49
+ }
50
+ };
51
+ var p = function() {
52
+ var t = this, s = t._self._c;
53
+ return t.TARGET === "vue2" || t.TARGET === "vue3" || t.TARGET === "svelte" ? s("render-inlined-styles", { attrs: { styles: t.css } }) : t._e();
54
+ }, $ = [], f = /* @__PURE__ */ r(
55
+ d,
56
+ p,
57
+ $,
58
+ !1,
59
+ null,
60
+ null,
61
+ null,
62
+ null
63
+ );
64
+ const h = f.exports;
65
+ export {
66
+ h as default
67
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index.dcdf302c.cjs"),r=require("./get-processed-block.2bcd0d2b.cjs"),i={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},c=e=>`@media (max-width: ${i[e].max}px)`,a=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),o=e=>Object.entries(e).map(([s,n])=>{if(typeof n=="string")return`${a(s)}: ${n};`}).join(`
2
+ `),d=()=>Promise.resolve().then(()=>require("./render-inlined-styles.b3a06398.cjs")).then(e=>e.default),u={name:"block-styles",components:{"render-inlined-styles":d},props:["block","context"],data:()=>({TARGET:l.TARGET}),computed:{useBlock(){return r.getProcessedBlock({block:this.block,state:this.context.state,context:this.context.context,shouldEvaluateBindings:!0})},css(){const e=this.useBlock.responsiveStyles,t=e==null?void 0:e.large,s=e==null?void 0:e.medium,n=e==null?void 0:e.small;return`
3
+ ${t?`.${this.useBlock.id} {${o(t)}}`:""}
4
+ ${s?`${c("medium")} {
5
+ .${this.useBlock.id} {${o(s)}}
6
+ }`:""}
7
+ ${n?`${c("small")} {
8
+ .${this.useBlock.id} {${o(n)}}
9
+ }`:""}
10
+ }`}}};var m=function(){var t=this,s=t._self._c;return t.TARGET==="vue2"||t.TARGET==="vue3"||t.TARGET==="svelte"?s("render-inlined-styles",{attrs:{styles:t.css}}):t._e()},p=[],$=l.normalizeComponent(u,m,p,!1,null,null,null,null);const f=$.exports;exports.default=f;
@@ -0,0 +1 @@
1
+ "use strict";const u=require("./index.dcdf302c.cjs"),d=(r,e,t)=>{if(Object(r)!==r)return r;const n=Array.isArray(e)?e:e.toString().match(/[^.[\]]+/g);return n.slice(0,-1).reduce((s,o,i)=>Object(s[o])===s[o]?s[o]:s[o]=Math.abs(Number(n[i+1]))>>0===+n[i+1]?[]:{},r)[n[n.length-1]]=t,r};var f=Object.defineProperty,l=Object.defineProperties,_=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,g=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,p=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,c=(r,e)=>{for(var t in e||(e={}))g.call(e,t)&&p(r,t,e[t]);if(a)for(var t of a(e))O.call(e,t)&&p(r,t,e[t]);return r},P=(r,e)=>l(r,_(e));const v=({block:r,context:e,state:t})=>{if(!r.bindings)return r;const n=P(c({},r),{properties:c({},r.properties),actions:c({},r.actions)});for(const s in r.bindings){const o=r.bindings[s],i=u.evaluate({code:o,state:t,context:e});d(n,s,i)}return n};function m({block:r,context:e,shouldEvaluateBindings:t,state:n}){const s=r;return t?v({block:s,state:n,context:e}):s}exports.getProcessedBlock=m;
@@ -0,0 +1,44 @@
1
+ import { e as u } from "./index.0622ae10.js";
2
+ const f = (r, e, t) => {
3
+ if (Object(r) !== r)
4
+ return r;
5
+ const n = Array.isArray(e) ? e : e.toString().match(/[^.[\]]+/g);
6
+ return n.slice(0, -1).reduce((s, o, i) => Object(s[o]) === s[o] ? s[o] : s[o] = Math.abs(Number(n[i + 1])) >> 0 === +n[i + 1] ? [] : {}, r)[n[n.length - 1]] = t, r;
7
+ };
8
+ var d = Object.defineProperty, _ = Object.defineProperties, g = Object.getOwnPropertyDescriptors, p = Object.getOwnPropertySymbols, l = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable, c = (r, e, t) => e in r ? d(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, a = (r, e) => {
9
+ for (var t in e || (e = {}))
10
+ l.call(e, t) && c(r, t, e[t]);
11
+ if (p)
12
+ for (var t of p(e))
13
+ O.call(e, t) && c(r, t, e[t]);
14
+ return r;
15
+ }, v = (r, e) => _(r, g(e));
16
+ const P = ({
17
+ block: r,
18
+ context: e,
19
+ state: t
20
+ }) => {
21
+ if (!r.bindings)
22
+ return r;
23
+ const n = v(a({}, r), {
24
+ properties: a({}, r.properties),
25
+ actions: a({}, r.actions)
26
+ });
27
+ for (const s in r.bindings) {
28
+ const o = r.bindings[s], i = u({ code: o, state: t, context: e });
29
+ f(n, s, i);
30
+ }
31
+ return n;
32
+ };
33
+ function y({
34
+ block: r,
35
+ context: e,
36
+ shouldEvaluateBindings: t,
37
+ state: n
38
+ }) {
39
+ const s = r;
40
+ return t ? P({ block: s, state: n, context: e }) : s;
41
+ }
42
+ export {
43
+ y as g
44
+ };