@builder.io/sdk-qwik 0.0.11 → 0.0.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.
Files changed (152) hide show
  1. package/.yarn/cache/@builder.io-qwik-npm-0.0.103-bdc7786a46-98363e9103.zip +0 -0
  2. package/.yarn/cache/@gar-promisify-npm-1.1.3-ac1a325862-4059f790e2.zip +0 -0
  3. package/.yarn/cache/@npmcli-fs-npm-2.1.2-08d434e77b-405074965e.zip +0 -0
  4. package/.yarn/cache/@npmcli-move-file-npm-2.0.1-b593d8f741-52dc02259d.zip +0 -0
  5. package/.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip +0 -0
  6. package/.yarn/cache/@types-node-npm-18.7.6-c1eafa3d9a-5122988c32.zip +0 -0
  7. package/.yarn/cache/abbrev-npm-1.1.1-3659247eab-a4a97ec07d.zip +0 -0
  8. package/.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip +0 -0
  9. package/.yarn/cache/agentkeepalive-npm-4.2.1-b86a9fb343-39cb49ed8c.zip +0 -0
  10. package/.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip +0 -0
  11. package/.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip +0 -0
  12. package/.yarn/cache/aproba-npm-2.0.0-8716bcfde6-5615cadcfb.zip +0 -0
  13. package/.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-52590c2486.zip +0 -0
  14. package/.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip +0 -0
  15. package/.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip +0 -0
  16. package/.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip +0 -0
  17. package/.yarn/cache/cacache-npm-16.1.2-0d36d1aaf1-defe1d6f55.zip +0 -0
  18. package/.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip +0 -0
  19. package/.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip +0 -0
  20. package/.yarn/cache/color-support-npm-1.1.3-3be5c53455-9b73568176.zip +0 -0
  21. package/.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip +0 -0
  22. package/.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip +0 -0
  23. package/.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip +0 -0
  24. package/.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip +0 -0
  25. package/.yarn/cache/depd-npm-1.1.2-b0c8414da7-6b406620d2.zip +0 -0
  26. package/.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip +0 -0
  27. package/.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip +0 -0
  28. package/.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip +0 -0
  29. package/.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip +0 -0
  30. package/.yarn/cache/esbuild-darwin-arm64-npm-0.14.54-ec53803fa6-8.zip +0 -0
  31. package/.yarn/cache/esbuild-npm-0.14.54-b3dcd8a41e-49e360b118.zip +0 -0
  32. package/.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip +0 -0
  33. package/.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip +0 -0
  34. package/.yarn/cache/fsevents-npm-2.3.2-a881d6ac9f-97ade64e75.zip +0 -0
  35. package/.yarn/cache/fsevents-patch-3340e2eb10-8.zip +0 -0
  36. package/.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip +0 -0
  37. package/.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip +0 -0
  38. package/.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip +0 -0
  39. package/.yarn/cache/glob-npm-8.0.3-750f909025-50bcdea19d.zip +0 -0
  40. package/.yarn/cache/graceful-fs-npm-4.2.10-79c70989ca-3f109d70ae.zip +0 -0
  41. package/.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip +0 -0
  42. package/.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip +0 -0
  43. package/.yarn/cache/http-cache-semantics-npm-4.1.0-860520a31f-974de94a81.zip +0 -0
  44. package/.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-e2ee1ff165.zip +0 -0
  45. package/.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip +0 -0
  46. package/.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip +0 -0
  47. package/.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip +0 -0
  48. package/.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip +0 -0
  49. package/.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip +0 -0
  50. package/.yarn/cache/infer-owner-npm-1.0.4-685ac3d2af-181e732764.zip +0 -0
  51. package/.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip +0 -0
  52. package/.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip +0 -0
  53. package/.yarn/cache/ip-npm-2.0.0-204facb3cc-cfcfac6b87.zip +0 -0
  54. package/.yarn/cache/is-core-module-npm-2.10.0-6dff9310aa-0f3f77811f.zip +0 -0
  55. package/.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip +0 -0
  56. package/.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip +0 -0
  57. package/.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip +0 -0
  58. package/.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip +0 -0
  59. package/.yarn/cache/lru-cache-npm-7.14.0-354cf654ec-efdd329f2c.zip +0 -0
  60. package/.yarn/cache/make-fetch-happen-npm-10.2.1-f1cc7cd2df-2332eb9a8e.zip +0 -0
  61. package/.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip +0 -0
  62. package/.yarn/cache/minimatch-npm-5.1.0-34f6240621-15ce53d31a.zip +0 -0
  63. package/.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip +0 -0
  64. package/.yarn/cache/minipass-fetch-npm-2.1.1-c4a8efdb09-1aae0c2240.zip +0 -0
  65. package/.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip +0 -0
  66. package/.yarn/cache/minipass-npm-3.3.5-a555b091e7-f89f02bcaa.zip +0 -0
  67. package/.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip +0 -0
  68. package/.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip +0 -0
  69. package/.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip +0 -0
  70. package/.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip +0 -0
  71. package/.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip +0 -0
  72. package/.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip +0 -0
  73. package/.yarn/cache/nanoid-npm-3.3.4-3d250377d6-2fddd6dee9.zip +0 -0
  74. package/.yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip +0 -0
  75. package/.yarn/cache/node-gyp-npm-9.1.0-2091059b31-1437fa4a87.zip +0 -0
  76. package/.yarn/cache/nopt-npm-5.0.0-304b40fbfe-d35fdec187.zip +0 -0
  77. package/.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-ae238cd264.zip +0 -0
  78. package/.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip +0 -0
  79. package/.yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip +0 -0
  80. package/.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip +0 -0
  81. package/.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip +0 -0
  82. package/.yarn/cache/picocolors-npm-1.0.0-d81e0b1927-a2e8092dd8.zip +0 -0
  83. package/.yarn/cache/postcss-npm-8.4.16-7367383579-10eee25efd.zip +0 -0
  84. package/.yarn/cache/promise-inflight-npm-1.0.1-5bb925afac-2274948309.zip +0 -0
  85. package/.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip +0 -0
  86. package/.yarn/cache/readable-stream-npm-3.6.0-23a4a5eb56-d4ea81502d.zip +0 -0
  87. package/.yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip +0 -0
  88. package/.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip +0 -0
  89. package/.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip +0 -0
  90. package/.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip +0 -0
  91. package/.yarn/cache/rollup-npm-2.78.0-09284f4c78-01b5a7ae08.zip +0 -0
  92. package/.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip +0 -0
  93. package/.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip +0 -0
  94. package/.yarn/cache/semver-npm-7.3.7-3bfe704194-2fa3e87756.zip +0 -0
  95. package/.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-6e65a05f7c.zip +0 -0
  96. package/.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip +0 -0
  97. package/.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip +0 -0
  98. package/.yarn/cache/socks-npm-2.7.0-cc1cb019db-0b5d94e2b3.zip +0 -0
  99. package/.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-7205543701.zip +0 -0
  100. package/.yarn/cache/source-map-js-npm-1.0.2-ee4f9f9b30-c049a7fc4d.zip +0 -0
  101. package/.yarn/cache/ssri-npm-9.0.1-33ce27f4f8-fb58f5e46b.zip +0 -0
  102. package/.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip +0 -0
  103. package/.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip +0 -0
  104. package/.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip +0 -0
  105. package/.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip +0 -0
  106. package/.yarn/cache/tar-npm-6.1.11-e6ac3cba9c-a04c07bb9e.zip +0 -0
  107. package/.yarn/cache/typescript-npm-4.7.4-65aa6ffb42-5750181b1c.zip +0 -0
  108. package/.yarn/cache/typescript-patch-ae154b3216-96d3030cb0.zip +0 -0
  109. package/.yarn/cache/unique-filename-npm-1.1.1-c885c5095b-cf4998c922.zip +0 -0
  110. package/.yarn/cache/unique-slug-npm-2.0.2-f6ba1ddeb7-5b6876a645.zip +0 -0
  111. package/.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip +0 -0
  112. package/.yarn/cache/vite-npm-3.0.2-a17ab24a12-10aebec0df.zip +0 -0
  113. package/.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip +0 -0
  114. package/.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip +0 -0
  115. package/.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip +0 -0
  116. package/.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip +0 -0
  117. package/.yarn/install-state.gz +0 -0
  118. package/README.md +15 -16
  119. package/lib/index.qwik.cjs +505 -224
  120. package/lib/index.qwik.mjs +506 -225
  121. package/package.json +4 -3
  122. package/src/blocks/button/button.jsx +7 -2
  123. package/src/blocks/columns/columns.jsx +9 -4
  124. package/src/blocks/embed/embed.jsx +1 -1
  125. package/src/blocks/form/builder-blocks.jsx +1 -1
  126. package/src/blocks/form/form.jsx +2 -2
  127. package/src/blocks/img/img.jsx +2 -2
  128. package/src/blocks/select/select.jsx +1 -1
  129. package/src/blocks/symbol/symbol.jsx +8 -7
  130. package/src/components/render-block/block-styles.jsx +1 -1
  131. package/src/components/render-block/render-block.jsx +28 -26
  132. package/src/components/render-block/render-component.jsx +4 -3
  133. package/src/components/render-block/render-repeated-block.jsx +4 -1
  134. package/src/components/render-blocks.jsx +2 -2
  135. package/src/components/render-content/render-content.jsx +19 -7
  136. package/src/components/render-inlined-styles.jsx +4 -3
  137. package/src/constants/builder-registered-components.js +3 -0
  138. package/src/functions/evaluate.js +1 -1
  139. package/src/functions/get-processed-block.js +10 -6
  140. package/src/functions/get-processed-block.test.js +1 -1
  141. package/src/functions/mark-mutable.js +14 -0
  142. package/src/functions/track.js +71 -2
  143. package/src/helpers/cookie.js +59 -0
  144. package/src/helpers/localStorage.js +34 -0
  145. package/src/helpers/nullable.js +4 -0
  146. package/src/helpers/sessionId.js +26 -0
  147. package/src/helpers/time.js +5 -0
  148. package/src/helpers/url.js +10 -0
  149. package/src/helpers/url.test.js +15 -0
  150. package/src/helpers/uuid.js +13 -0
  151. package/src/helpers/visitorId.js +33 -0
  152. package/src/types/can-track.js +0 -0
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.0.11",
3
+ "version": "0.0.14",
4
4
  "description": "Builder.io Qwik SDK",
5
5
  "type": "module",
6
6
  "main": "./lib/index.qwik.cjs",
7
7
  "module": "./lib/index.qwik.mjs",
8
8
  "qwik": "./lib/index.qwik.mjs",
9
+ "types": "./types.d.ts",
9
10
  "exports": {
10
11
  ".": {
11
12
  "import": "./lib/index.qwik.mjs",
@@ -17,12 +18,12 @@
17
18
  "release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag latest --access public"
18
19
  },
19
20
  "devDependencies": {
20
- "@builder.io/qwik": "0.0.100",
21
+ "@builder.io/qwik": "0.0.103",
21
22
  "@types/node": "latest",
22
23
  "typescript": "4.7.4",
23
24
  "vite": "3.0.2"
24
25
  },
25
26
  "peerDependencies": {
26
- "@builder.io/qwik": "^0.0.100"
27
+ "@builder.io/qwik": "0.0.103"
27
28
  }
28
29
  }
@@ -1,7 +1,8 @@
1
1
  // GENERATED BY MITOSIS
2
2
 
3
- import { Fragment, component$, h } from "@builder.io/qwik";
3
+ import { Fragment, component$, h, useStylesScoped$ } from "@builder.io/qwik";
4
4
  export const Button = component$((props) => {
5
+ useStylesScoped$(STYLES);
5
6
  return (
6
7
  <Fragment>
7
8
  {props.link ? (
@@ -14,9 +15,13 @@ export const Button = component$((props) => {
14
15
  {props.text}
15
16
  </a>
16
17
  ) : (
17
- <span {...props.attributes}>{props.text}</span>
18
+ <button class="button-Button" {...props.attributes}>
19
+ {props.text}
20
+ </button>
18
21
  )}
19
22
  </Fragment>
20
23
  );
21
24
  });
22
25
  export default Button;
26
+ export const STYLES = `.button-Button {
27
+ all: unset; }`;
@@ -1,6 +1,7 @@
1
1
  // GENERATED BY MITOSIS
2
2
 
3
3
  import RenderBlocks from "../../components/render-blocks";
4
+ import { markMutable } from "../../functions/mark-mutable";
4
5
  import { Fragment, component$, h, useStylesScoped$ } from "@builder.io/qwik";
5
6
  export const getGutterSize = function getGutterSize(props, state) {
6
7
  return typeof props.space === "number" ? props.space || 0 : 20;
@@ -65,7 +66,7 @@ export const Columns = component$((props) => {
65
66
  class="builder-columns div-Columns"
66
67
  style={columnsCssVars(props, state)}
67
68
  >
68
- {(props.columns || []).map((column, index) => {
69
+ {(props.columns || []).map(function (column, index) {
69
70
  return (
70
71
  <div
71
72
  class="builder-column div-Columns-2"
@@ -76,7 +77,11 @@ export const Columns = component$((props) => {
76
77
  }}
77
78
  key={index}
78
79
  >
79
- <RenderBlocks blocks={column.blocks}></RenderBlocks>
80
+ <RenderBlocks
81
+ blocks={markMutable(column.blocks)}
82
+ path={`component.options.columns.${index}.blocks`}
83
+ parent={props.builderBlock.id}
84
+ ></RenderBlocks>
80
85
  </div>
81
86
  );
82
87
  })}
@@ -87,10 +92,10 @@ export default Columns;
87
92
  export const STYLES = `.div-Columns {
88
93
  display: flex;
89
94
  align-items: stretch;
90
- line-height: normal; }@media (max-width: 999px) { .div-Columns {
95
+ line-height: normal; }@media (max-width: 991px) { .div-Columns {
91
96
  flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
92
97
  flex-direction: var(--flex-dir); } }.div-Columns-2 {
93
- flex-grow: 1; }@media (max-width: 999px) { .div-Columns-2 {
98
+ flex-grow: 1; }@media (max-width: 991px) { .div-Columns-2 {
94
99
  width: var(--column-width-tablet) !important;
95
100
  margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
96
101
  width: var(--column-width) !important;
@@ -41,9 +41,9 @@ export const findAndRunScripts = function findAndRunScripts(
41
41
  export const Embed = component$((props) => {
42
42
  const elem = useRef();
43
43
  const state = useStore({
44
+ ranInitFn: false,
44
45
  scriptsInserted: [],
45
46
  scriptsRun: [],
46
- ranInitFn: false,
47
47
  });
48
48
  useWatch$(({ track }) => {
49
49
  state && track(state, "ranInitFn");
@@ -4,7 +4,7 @@ import { Fragment, component$, h } from "@builder.io/qwik";
4
4
  export const BuilderBlocks = component$((props) => {
5
5
  return (
6
6
  <Fragment>
7
- NOT YET IMPLEMENTED: <code>BuilderBlocks</code>
7
+ NOT YET IMPLEMENTED: <code>BuilderBlocks {JSON.stringify(props)}</code>
8
8
  </Fragment>
9
9
  );
10
10
  });
@@ -244,9 +244,9 @@ export const FormComponent = component$((props) => {
244
244
  const builderContext = useContext(BuilderContext);
245
245
  const formRef = useRef();
246
246
  const state = useStore({
247
+ formErrorMessage: "",
247
248
  formState: "unsubmitted",
248
249
  responseData: null,
249
- formErrorMessage: "",
250
250
  });
251
251
  return (
252
252
  <form
@@ -263,7 +263,7 @@ export const FormComponent = component$((props) => {
263
263
  {...props.attributes}
264
264
  >
265
265
  {props.builderBlock && props.builderBlock.children
266
- ? (props.builderBlock?.children || []).map((block) => {
266
+ ? (props.builderBlock?.children || []).map(function (block) {
267
267
  return (
268
268
  <RenderBlock block={block} context={builderContext}></RenderBlock>
269
269
  );
@@ -9,10 +9,10 @@ export const ImgComponent = component$((props) => {
9
9
  objectFit: props.backgroundSize || "cover",
10
10
  objectPosition: props.backgroundPosition || "center",
11
11
  }}
12
- {...props.attributes}
13
12
  key={(isEditing() && props.imgSrc) || "default-key"}
14
13
  alt={props.altText}
15
- src={props.imgSrc}
14
+ src={props.imgSrc || props.image}
15
+ {...props.attributes}
16
16
  ></img>
17
17
  );
18
18
  });
@@ -13,7 +13,7 @@ export const SelectComponent = component$((props) => {
13
13
  defaultValue={props.defaultValue}
14
14
  name={props.name}
15
15
  >
16
- {(props.options || []).map((option) => {
16
+ {(props.options || []).map(function (option) {
17
17
  return (
18
18
  <option value={option.value}>{option.name || option.value}</option>
19
19
  );
@@ -3,6 +3,7 @@
3
3
  import RenderContent from "../../components/render-content/render-content";
4
4
  import BuilderContext from "../../context/builder.context";
5
5
  import { getContent } from "../../functions/get-content/index.js";
6
+ import { markMutable } from "../../functions/mark-mutable";
6
7
  import {
7
8
  Fragment,
8
9
  component$,
@@ -19,9 +20,7 @@ export const Symbol = component$((props) => {
19
20
  state.content = props.symbol?.content;
20
21
  });
21
22
  useWatch$(({ track }) => {
22
- props.symbol && track(props.symbol, "content");
23
- props.symbol && track(props.symbol, "model");
24
- props.symbol && track(props.symbol, "entry");
23
+ props && track(props, "symbol");
25
24
  state && track(state, "content");
26
25
  const symbolToUse = props.symbol;
27
26
  /**
@@ -62,14 +61,16 @@ export const Symbol = component$((props) => {
62
61
  <RenderContent
63
62
  apiKey={builderContext.apiKey}
64
63
  context={builderContext.context}
65
- customComponents={Object.values(builderContext.registeredComponents)}
66
- data={{
64
+ customComponents={markMutable(
65
+ Object.values(builderContext.registeredComponents)
66
+ )}
67
+ data={markMutable({
67
68
  ...props.symbol?.data,
68
69
  ...builderContext.state,
69
70
  ...props.symbol?.content?.data?.state,
70
- }}
71
+ })}
71
72
  model={props.symbol?.model}
72
- content={state.content}
73
+ content={markMutable(state.content)}
73
74
  ></RenderContent>
74
75
  </div>
75
76
  );
@@ -11,7 +11,7 @@ export const useBlock = function useBlock(props, state) {
11
11
  block: props.block,
12
12
  state: props.context.state,
13
13
  context: props.context.context,
14
- evaluateBindings: true,
14
+ shouldEvaluateBindings: true,
15
15
  });
16
16
  };
17
17
  export const css = function css(props, state) {
@@ -17,7 +17,7 @@ export const component = function component(props, state) {
17
17
  block: props.block,
18
18
  state: props.context.state,
19
19
  context: props.context.context,
20
- evaluateBindings: false,
20
+ shouldEvaluateBindings: false,
21
21
  }).component?.name;
22
22
 
23
23
  if (!componentName) {
@@ -57,7 +57,7 @@ export const useBlock = function useBlock(props, state) {
57
57
  block: props.block,
58
58
  state: props.context.state,
59
59
  context: props.context.context,
60
- evaluateBindings: true,
60
+ shouldEvaluateBindings: true,
61
61
  });
62
62
  };
63
63
  export const attributes = function attributes(props, state) {
@@ -167,13 +167,15 @@ export const RenderBlock = (props) => {
167
167
  !isEmptyHtmlElement(tagName(props, state)) ? (
168
168
  <state.tagName {...attributes(props, state)}>
169
169
  {repeatItemData(props, state)
170
- ? (repeatItemData(props, state) || []).map((data, index) => {
170
+ ? (repeatItemData(props, state) || []).map(function (
171
+ data,
172
+ index
173
+ ) {
171
174
  return (
172
175
  <RenderRepeatedBlock
173
176
  key={index}
174
177
  repeatContext={data.context}
175
178
  block={data.block}
176
- context={props.context}
177
179
  ></RenderRepeatedBlock>
178
180
  );
179
181
  })
@@ -183,28 +185,28 @@ export const RenderBlock = (props) => {
183
185
  {...renderComponentProps(props, state)}
184
186
  ></RenderComponent>
185
187
  ) : null}
186
- {(childrenWithoutParentComponent(props, state) || []).map(
187
- (child) => {
188
- return (
189
- <RenderBlock
190
- key={"render-block-" + child.id}
191
- block={child}
192
- context={props.context}
193
- ></RenderBlock>
194
- );
195
- }
196
- )}
197
- {(childrenWithoutParentComponent(props, state) || []).map(
198
- (child) => {
199
- return (
200
- <BlockStyles
201
- key={"block-style-" + child.id}
202
- block={child}
203
- context={props.context}
204
- ></BlockStyles>
205
- );
206
- }
207
- )}
188
+ {(childrenWithoutParentComponent(props, state) || []).map(function (
189
+ child
190
+ ) {
191
+ return (
192
+ <RenderBlock
193
+ key={"render-block-" + child.id}
194
+ block={child}
195
+ context={props.context}
196
+ ></RenderBlock>
197
+ );
198
+ })}
199
+ {(childrenWithoutParentComponent(props, state) || []).map(function (
200
+ child
201
+ ) {
202
+ return (
203
+ <BlockStyles
204
+ key={"block-style-" + child.id}
205
+ block={child}
206
+ context={props.context}
207
+ ></BlockStyles>
208
+ );
209
+ })}
208
210
  </state.tagName>
209
211
  ) : (
210
212
  <state.tagName {...attributes(props, state)}></state.tagName>
@@ -1,5 +1,6 @@
1
1
  // GENERATED BY MITOSIS
2
2
 
3
+ import { markPropsMutable } from "../../functions/mark-mutable.js";
3
4
  import BlockStyles from "./block-styles";
4
5
  import RenderBlock from "./render-block";
5
6
  import { Fragment, h } from "@builder.io/qwik";
@@ -7,8 +8,8 @@ export const RenderComponent = (props) => {
7
8
  return (
8
9
  <>
9
10
  {props.componentRef ? (
10
- <props.componentRef {...props.componentOptions}>
11
- {(props.blockChildren || []).map((child) => {
11
+ <props.componentRef {...markPropsMutable(props.componentOptions)}>
12
+ {(props.blockChildren || []).map(function (child) {
12
13
  return (
13
14
  <RenderBlock
14
15
  key={"render-block-" + child.id}
@@ -17,7 +18,7 @@ export const RenderComponent = (props) => {
17
18
  ></RenderBlock>
18
19
  );
19
20
  })}
20
- {(props.blockChildren || []).map((child) => {
21
+ {(props.blockChildren || []).map(function (child) {
21
22
  return (
22
23
  <BlockStyles
23
24
  key={"block-style-" + child.id}
@@ -31,7 +31,10 @@ export const RenderRepeatedBlock = component$((props) => {
31
31
  })
32
32
  );
33
33
  return (
34
- <RenderBlock block={props.block} context={props.context}></RenderBlock>
34
+ <RenderBlock
35
+ block={props.block}
36
+ context={props.repeatContext}
37
+ ></RenderBlock>
35
38
  );
36
39
  });
37
40
  export default RenderRepeatedBlock;
@@ -62,7 +62,7 @@ export const RenderBlocks = component$((props) => {
62
62
  onMouseEnter$={(event) => onMouseEnter(props, state, builderContext)}
63
63
  >
64
64
  {props.blocks
65
- ? (props.blocks || []).map((block) => {
65
+ ? (props.blocks || []).map(function (block) {
66
66
  return (
67
67
  <RenderBlock
68
68
  key={"render-block-" + block.id}
@@ -73,7 +73,7 @@ export const RenderBlocks = component$((props) => {
73
73
  })
74
74
  : null}
75
75
  {props.blocks
76
- ? (props.blocks || []).map((block) => {
76
+ ? (props.blocks || []).map(function (block) {
77
77
  return (
78
78
  <BlockStyles
79
79
  key={"block-style-" + block.id}
@@ -9,6 +9,7 @@ import { getFetch } from "../../functions/get-fetch.js";
9
9
  import { isBrowser } from "../../functions/is-browser.js";
10
10
  import { isEditing } from "../../functions/is-editing.js";
11
11
  import { isPreviewing } from "../../functions/is-previewing.js";
12
+ import { markMutable } from "../../functions/mark-mutable.js";
12
13
  import {
13
14
  components,
14
15
  createRegisterComponentMessage,
@@ -44,6 +45,9 @@ export const useContent = function useContent(props, state, elementRef) {
44
45
  };
45
46
  return mergedContent;
46
47
  };
48
+ export const canTrackToUse = function canTrackToUse(props, state, elementRef) {
49
+ return props.canTrack || true;
50
+ };
47
51
  export const contentState = function contentState(props, state, elementRef) {
48
52
  return {
49
53
  ...props.content?.data?.state,
@@ -131,9 +135,12 @@ export const httpReqsData = function httpReqsData(props, state, elementRef) {
131
135
  return {};
132
136
  };
133
137
  export const onClick = function onClick(props, state, elementRef, _event) {
134
- if (useContent(props, state, elementRef) && props.canTrack !== false) {
135
- track("click", {
138
+ if (useContent(props, state, elementRef)) {
139
+ track({
140
+ type: "click",
141
+ canTrack: canTrackToUse(props, state, elementRef),
136
142
  contentId: useContent(props, state, elementRef).id,
143
+ orgId: props.apiKey,
137
144
  });
138
145
  }
139
146
  };
@@ -218,8 +225,8 @@ export const RenderContent = component$((props) => {
218
225
  const state = useStore({
219
226
  forceReRenderCount: 0,
220
227
  overrideContent: null,
221
- update: 0,
222
228
  overrideState: {},
229
+ update: 0,
223
230
  });
224
231
  useContextProvider(
225
232
  BuilderContext,
@@ -244,7 +251,7 @@ export const RenderContent = component$((props) => {
244
251
  useClientEffect$(() => {
245
252
  if (isBrowser()) {
246
253
  if (isEditing()) {
247
- state.forceReRenderCount++;
254
+ state.forceReRenderCount = state.forceReRenderCount + 1;
248
255
  _useMutableProps(elementRef.current, true);
249
256
 
250
257
  registerInsertMenu();
@@ -265,9 +272,12 @@ export const RenderContent = component$((props) => {
265
272
  );
266
273
  }
267
274
 
268
- if (useContent(props, state, elementRef) && props.canTrack !== false) {
269
- track("impression", {
275
+ if (useContent(props, state, elementRef)) {
276
+ track({
277
+ type: "impression",
278
+ canTrack: canTrackToUse(props, state, elementRef),
270
279
  contentId: useContent(props, state, elementRef).id,
280
+ orgId: props.apiKey,
271
281
  });
272
282
  } // override normal content in preview mode
273
283
 
@@ -340,7 +350,9 @@ export const RenderContent = component$((props) => {
340
350
  ></RenderContentStyles>
341
351
  ) : null}
342
352
  <RenderBlocks
343
- blocks={useContent(props, state, elementRef)?.data?.blocks}
353
+ blocks={markMutable(
354
+ useContent(props, state, elementRef)?.data?.blocks
355
+ )}
344
356
  key={state.forceReRenderCount}
345
357
  ></RenderBlocks>
346
358
  </div>
@@ -1,7 +1,7 @@
1
1
  // GENERATED BY MITOSIS
2
2
 
3
3
  import { TARGET } from "../constants/target.js";
4
- import { Fragment, component$, h } from "@builder.io/qwik";
4
+ import { Fragment, h } from "@builder.io/qwik";
5
5
  export const injectedStyleScript = function injectedStyleScript(props, state) {
6
6
  return `<${tagName(props, state)}>${props.styles}</${tagName(props, state)}>`;
7
7
  };
@@ -10,8 +10,9 @@ export const tagName = function tagName(props, state) {
10
10
  // https://github.com/sveltejs/vite-plugin-svelte/issues/315#issuecomment-1109000027
11
11
  return "sty" + "le";
12
12
  };
13
- export const RenderInlinedStyles = component$((props) => {
13
+ export const RenderInlinedStyles = (props) => {
14
14
  const state = {};
15
+ state.tagName = tagName(props, state);
15
16
  return (
16
17
  <>
17
18
  {TARGET === "svelte" ? (
@@ -21,5 +22,5 @@ export const RenderInlinedStyles = component$((props) => {
21
22
  )}
22
23
  </>
23
24
  );
24
- });
25
+ };
25
26
  export default RenderInlinedStyles;
@@ -32,9 +32,12 @@ import { componentInfo as videoComponentInfo } from "../blocks/video/component-i
32
32
  import { default as Video } from "../blocks/video/video.jsx";
33
33
  import { componentInfo as embedComponentInfo } from "../blocks/embed/component-info";
34
34
  import { default as embed } from "../blocks/embed/embed.jsx";
35
+ import { default as Img } from "../blocks/img/img.jsx";
36
+ import { componentInfo as imgComponentInfo } from "../blocks/img/component-info";
35
37
  const getDefaultRegisteredComponents = () => [
36
38
  __spreadValues({ component: Columns }, columnsComponentInfo),
37
39
  __spreadValues({ component: Image }, imageComponentInfo),
40
+ __spreadValues({ component: Img }, imgComponentInfo),
38
41
  __spreadValues({ component: Text }, textComponentInfo),
39
42
  __spreadValues({ component: Video }, videoComponentInfo),
40
43
  __spreadValues({ component: Symbol }, symbolComponentInfo),
@@ -20,7 +20,7 @@ function evaluate({
20
20
  try {
21
21
  return new Function("builder", "Builder", "state", "context", "event", useCode)(builder, builder, state, context, event);
22
22
  } catch (e) {
23
- console.warn("Builder custom code error: ", e);
23
+ console.warn("Builder custom code error: \n While Evaluating: \n ", useCode, "\n", e.message || e);
24
24
  }
25
25
  }
26
26
  export {
@@ -39,13 +39,17 @@ const evaluateBindings = ({
39
39
  }
40
40
  return copied;
41
41
  };
42
- function getProcessedBlock(options) {
43
- const { state, context } = options;
44
- const block = transformBlock(options.block);
45
- if (evaluateBindings) {
46
- return evaluateBindings({ block, state, context });
42
+ function getProcessedBlock({
43
+ block,
44
+ context,
45
+ shouldEvaluateBindings,
46
+ state
47
+ }) {
48
+ const transformedBlock = transformBlock(block);
49
+ if (shouldEvaluateBindings) {
50
+ return evaluateBindings({ block: transformedBlock, state, context });
47
51
  } else {
48
- return block;
52
+ return transformedBlock;
49
53
  }
50
54
  }
51
55
  export {
@@ -21,7 +21,7 @@ test("Can process bindings", () => {
21
21
  block,
22
22
  context: {},
23
23
  state: { test: "hello" },
24
- evaluateBindings: true
24
+ shouldEvaluateBindings: true
25
25
  });
26
26
  expect(processed).not.toEqual(block);
27
27
  expect((_a = processed.properties) == null ? void 0 : _a.foo).toEqual("baz");
@@ -0,0 +1,14 @@
1
+ import { mutable } from "@builder.io/qwik";
2
+ function markMutable(value) {
3
+ return mutable(value);
4
+ }
5
+ function markPropsMutable(props) {
6
+ Object.keys(props).forEach((key) => {
7
+ props[key] = mutable(props[key]);
8
+ });
9
+ return props;
10
+ }
11
+ export {
12
+ markMutable,
13
+ markPropsMutable
14
+ };
@@ -1,7 +1,74 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
1
32
  import { TARGET } from "../constants/target.js";
33
+ import { getSessionId } from "../helpers/sessionId.js";
34
+ import { getVisitorId } from "../helpers/visitorId.js";
2
35
  import { isBrowser } from "./is-browser.js";
3
36
  import { isEditing } from "./is-editing.js";
4
- function track(event, properties) {
37
+ const getTrackingEventData = ({ canTrack }) => {
38
+ if (!canTrack) {
39
+ return { visitorId: void 0, sessionId: void 0 };
40
+ }
41
+ const sessionId = getSessionId({ canTrack });
42
+ const visitorId = getVisitorId({ canTrack });
43
+ return {
44
+ sessionId,
45
+ visitorId
46
+ };
47
+ };
48
+ const createEvent = (_a) => {
49
+ var _b = _a, {
50
+ type: eventType,
51
+ canTrack,
52
+ orgId,
53
+ contentId
54
+ } = _b, properties = __objRest(_b, [
55
+ "type",
56
+ "canTrack",
57
+ "orgId",
58
+ "contentId"
59
+ ]);
60
+ return {
61
+ type: eventType,
62
+ data: __spreadProps(__spreadValues(__spreadValues({}, properties), getTrackingEventData({ canTrack })), {
63
+ ownerId: orgId,
64
+ contentId
65
+ })
66
+ };
67
+ };
68
+ function track(eventProps) {
69
+ if (!eventProps.canTrack) {
70
+ return;
71
+ }
5
72
  if (isEditing()) {
6
73
  return;
7
74
  }
@@ -10,7 +77,9 @@ function track(event, properties) {
10
77
  }
11
78
  return fetch(`https://builder.io/api/v1/track`, {
12
79
  method: "POST",
13
- body: JSON.stringify({ events: [{ type: event, data: properties }] }),
80
+ body: JSON.stringify({
81
+ events: [createEvent(eventProps)]
82
+ }),
14
83
  headers: {
15
84
  "content-type": "application/json"
16
85
  },