@builder.io/sdk-svelte 0.0.1-1 → 0.0.1-4

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 (49) hide show
  1. package/package.json +15 -4
  2. package/src/blocks/button/index.js +2 -2
  3. package/src/blocks/columns/index.js +2 -2
  4. package/src/blocks/custom-code/index.js +2 -2
  5. package/src/blocks/embed/index.js +2 -2
  6. package/src/blocks/form/form.svelte +1 -1
  7. package/src/blocks/form/index.js +2 -2
  8. package/src/blocks/fragment/index.js +2 -2
  9. package/src/blocks/image/index.js +2 -2
  10. package/src/blocks/img/img.svelte +1 -1
  11. package/src/blocks/img/index.js +2 -2
  12. package/src/blocks/input/index.js +2 -2
  13. package/src/blocks/input/input.svelte +1 -1
  14. package/src/blocks/raw-text/index.js +2 -2
  15. package/src/blocks/section/index.js +2 -2
  16. package/src/blocks/select/index.js +2 -2
  17. package/src/blocks/select/select.svelte +1 -1
  18. package/src/blocks/submit-button/index.js +2 -2
  19. package/src/blocks/symbol/index.js +2 -2
  20. package/src/blocks/symbol/symbol.svelte +1 -1
  21. package/src/blocks/text/index.js +2 -2
  22. package/src/blocks/textarea/index.js +2 -2
  23. package/src/blocks/video/index.js +2 -2
  24. package/src/components/render-block/render-block.svelte +8 -8
  25. package/src/components/render-blocks.svelte +1 -1
  26. package/src/components/render-content/render-content.svelte +10 -10
  27. package/src/components/render-inlined-styles.svelte +1 -1
  28. package/src/functions/evaluate.js +2 -2
  29. package/src/functions/get-block-actions.js +2 -2
  30. package/src/functions/get-block-styles.js +1 -1
  31. package/src/functions/get-content/fn.test.js +1 -1
  32. package/src/functions/get-content/index.js +1 -1
  33. package/src/functions/get-fetch.js +1 -1
  34. package/src/functions/get-processed-block.js +3 -3
  35. package/src/functions/get-processed-block.test.js +1 -1
  36. package/src/functions/if-target.js +1 -1
  37. package/src/functions/is-editing.js +1 -1
  38. package/src/functions/is-iframe.js +1 -1
  39. package/src/functions/is-previewing.js +2 -2
  40. package/src/functions/on-change.test.js +1 -1
  41. package/src/functions/previewing-model-name.js +1 -1
  42. package/src/functions/register-component.js +1 -1
  43. package/src/functions/register.js +1 -1
  44. package/src/functions/set-editor-settings.js +1 -1
  45. package/src/functions/set.test.js +1 -1
  46. package/src/functions/track.js +3 -3
  47. package/src/index-helpers/blocks-exports.js +8 -8
  48. package/src/index.js +10 -10
  49. package/src/scripts/init-editing.js +4 -4
package/package.json CHANGED
@@ -1,12 +1,23 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.0.1-1",
5
- "dependencies": {
6
- "node-fetch": "^2.6.1"
4
+ "version": "0.0.1-4",
5
+ "type": "module",
6
+ "files": [
7
+ "src"
8
+ ],
9
+ "main": "./src/index.js",
10
+ "module": "./src/index.js",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./src/index.js",
14
+ "require": "./src/index.js"
15
+ }
7
16
  },
8
- "main": "src/index.js",
9
17
  "scripts": {
10
18
  "release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
19
+ },
20
+ "dependencies": {
21
+ "node-fetch": "^2.6.1"
11
22
  }
12
23
  }
@@ -1,6 +1,6 @@
1
- import { registerComponent } from "../../functions/register-component";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
2
  import component from "./button.svelte";
3
- import { componentInfo } from "./component-info";
3
+ import { componentInfo } from "./component-info.js";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
6
6
  stdin_default as default
@@ -1,6 +1,6 @@
1
- import { registerComponent } from "../../functions/register-component";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
2
  import component from "./columns.svelte";
3
- import { componentInfo } from "./component-info";
3
+ import { componentInfo } from "./component-info.js";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
6
6
  stdin_default as default
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./custom-code.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./embed.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import RenderBlock, { } from '../../components/render-block/render-block.svelte';
7
- import { isEditing } from '../../functions/is-editing';
7
+ import { isEditing } from '../../functions/is-editing.js';
8
8
 
9
9
 
10
10
 
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./form.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./fragment.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./image.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- import { isEditing } from '../../functions/is-editing';
6
+ import { isEditing } from '../../functions/is-editing.js';
7
7
 
8
8
 
9
9
 
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./img.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./input.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- import { isEditing } from '../../functions/is-editing';
6
+ import { isEditing } from '../../functions/is-editing.js';
7
7
 
8
8
 
9
9
 
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./raw-text.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./section.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./select.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- import { isEditing } from '../../functions/is-editing';
6
+ import { isEditing } from '../../functions/is-editing.js';
7
7
 
8
8
 
9
9
 
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./submit-button.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./symbol.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -5,7 +5,7 @@
5
5
 
6
6
  import RenderContent, { } from '../../components/render-content/render-content.svelte';
7
7
  import BuilderContext, { } from '../../context/builder.context';
8
- import { getContent } from '../../functions/get-content';
8
+ import { getContent } from '../../functions/get-content/index.js';
9
9
 
10
10
 
11
11
 
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./text.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./textarea.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -1,5 +1,5 @@
1
- import { registerComponent } from "../../functions/register-component";
2
- import { componentInfo } from "./component-info";
1
+ import { registerComponent } from "../../functions/register-component.js";
2
+ import { componentInfo } from "./component-info.js";
3
3
  import component from "./video.svelte";
4
4
  var stdin_default = registerComponent(component, componentInfo);
5
5
  export {
@@ -3,15 +3,15 @@
3
3
 
4
4
 
5
5
 
6
- import { TARGET } from '../../constants/target';
6
+ import { TARGET } from '../../constants/target.js';
7
7
  import BuilderContext, { } from '../../context/builder.context';
8
- import { getBlockActions } from '../../functions/get-block-actions';
9
- import { getBlockComponentOptions } from '../../functions/get-block-component-options';
10
- import { getBlockProperties } from '../../functions/get-block-properties';
11
- import { getBlockStyles } from '../../functions/get-block-styles';
12
- import { getBlockTag } from '../../functions/get-block-tag';
13
- import { getProcessedBlock } from '../../functions/get-processed-block';
14
- import { components } from '../../functions/register-component';
8
+ import { getBlockActions } from '../../functions/get-block-actions.js';
9
+ import { getBlockComponentOptions } from '../../functions/get-block-component-options.js';
10
+ import { getBlockProperties } from '../../functions/get-block-properties.js';
11
+ import { getBlockStyles } from '../../functions/get-block-styles.js';
12
+ import { getBlockTag } from '../../functions/get-block-tag.js';
13
+ import { getProcessedBlock } from '../../functions/get-processed-block.js';
14
+ import { components } from '../../functions/register-component.js';
15
15
  import BlockStyles, { } from './block-styles.svelte';
16
16
 
17
17
 
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- import { isEditing } from '../functions/is-editing';
6
+ import { isEditing } from '../functions/is-editing.js';
7
7
  import RenderBlock, { } from './render-block/render-block.svelte';
8
8
 
9
9
 
@@ -3,17 +3,17 @@
3
3
  import { afterUpdate } from 'svelte'
4
4
  import { onDestroy } from 'svelte'
5
5
 
6
- import { TARGET } from '../../constants/target';
6
+ import { TARGET } from '../../constants/target.js';
7
7
  import BuilderContext, { } from '../../context/builder.context';
8
- import { evaluate } from '../../functions/evaluate';
9
- import { convertSearchParamsToQueryObject , getBuilderSearchParams } from '../../functions/get-builder-search-params';
10
- import { getContent } from '../../functions/get-content';
11
- import { getFetch } from '../../functions/get-fetch';
12
- import { isBrowser } from '../../functions/is-browser';
13
- import { isEditing } from '../../functions/is-editing';
14
- import { isPreviewing } from '../../functions/is-previewing';
15
- import { previewingModelName } from '../../functions/previewing-model-name';
16
- import { track } from '../../functions/track';
8
+ import { evaluate } from '../../functions/evaluate.js';
9
+ import { convertSearchParamsToQueryObject , getBuilderSearchParams } from '../../functions/get-builder-search-params/index.js';
10
+ import { getContent } from '../../functions/get-content/index.js';
11
+ import { getFetch } from '../../functions/get-fetch.js';
12
+ import { isBrowser } from '../../functions/is-browser.js';
13
+ import { isEditing } from '../../functions/is-editing.js';
14
+ import { isPreviewing } from '../../functions/is-previewing.js';
15
+ import { previewingModelName } from '../../functions/previewing-model-name.js';
16
+ import { track } from '../../functions/track.js';
17
17
  import RenderBlocks, { } from '../render-blocks.svelte';
18
18
  import RenderContentStyles, { } from './components/render-styles.svelte';
19
19
 
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- import { TARGET } from '../constants/target';
6
+ import { TARGET } from '../constants/target.js';
7
7
 
8
8
 
9
9
 
@@ -1,5 +1,5 @@
1
- import { isBrowser } from "./is-browser";
2
- import { isEditing } from "./is-editing";
1
+ import { isBrowser } from "./is-browser.js";
2
+ import { isEditing } from "./is-editing.js";
3
3
  function evaluate({
4
4
  code,
5
5
  context,
@@ -1,5 +1,5 @@
1
- import { evaluate } from "./evaluate";
2
- import { getEventHandlerName } from "./event-handler-name";
1
+ import { evaluate } from "./evaluate.js";
2
+ import { getEventHandlerName } from "./event-handler-name.js";
3
3
  function getBlockActions(options) {
4
4
  var _a;
5
5
  const obj = {};
@@ -14,7 +14,7 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- import { sizes } from "../constants/device-sizes";
17
+ import { sizes } from "../constants/device-sizes.js";
18
18
  function getBlockStyles(block) {
19
19
  var _a, _b, _c, _d, _e;
20
20
  const styles = __spreadValues(__spreadValues({}, (_a = block.responsiveStyles) == null ? void 0 : _a.large), block.styles);
@@ -1,4 +1,4 @@
1
- import { generateContentUrl } from ".";
1
+ import { generateContentUrl } from "..js";
2
2
  const testKey = "YJIGb4i01jvw0SRdL5Bt";
3
3
  const testModel = "page";
4
4
  const testId = "c1b81bab59704599b997574eb0736def";
@@ -37,7 +37,7 @@ var __async = (__this, __arguments, generator) => {
37
37
  step((generator = generator.apply(__this, __arguments)).next());
38
38
  });
39
39
  };
40
- import { getFetch } from "../get-fetch";
40
+ import { getFetch } from "../get-fetch.js";
41
41
  const fetch$ = getFetch();
42
42
  function flatten(object, path = null, separator = ".") {
43
43
  return Object.keys(object).reduce((acc, key) => {
@@ -18,7 +18,7 @@ var __async = (__this, __arguments, generator) => {
18
18
  step((generator = generator.apply(__this, __arguments)).next());
19
19
  });
20
20
  };
21
- import { getGlobalThis } from "./get-global-this";
21
+ import { getGlobalThis } from "./get-global-this.js";
22
22
  function getFetch() {
23
23
  return __async(this, null, function* () {
24
24
  const globalFetch = getGlobalThis().fetch;
@@ -17,9 +17,9 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { evaluate } from "./evaluate";
21
- import { set } from "./set";
22
- import { transformBlock } from "./transform-block";
20
+ import { evaluate } from "./evaluate.js";
21
+ import { set } from "./set.js";
22
+ import { transformBlock } from "./transform-block.js";
23
23
  function getProcessedBlock(options) {
24
24
  const { state, context } = options;
25
25
  const block = transformBlock(options.block);
@@ -1,4 +1,4 @@
1
- import { getProcessedBlock } from "./get-processed-block";
1
+ import { getProcessedBlock } from "./get-processed-block.js";
2
2
  test("Can process bindings", () => {
3
3
  var _a, _b, _c, _d, _e, _f;
4
4
  const block = {
@@ -1,4 +1,4 @@
1
- import { TARGET } from "../constants/target";
1
+ import { TARGET } from "../constants/target.js";
2
2
  function ifTarget({
3
3
  targets,
4
4
  doThing,
@@ -1,4 +1,4 @@
1
- import { isIframe } from "./is-iframe";
1
+ import { isIframe } from "./is-iframe.js";
2
2
  function isEditing() {
3
3
  return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { isBrowser } from "./is-browser";
1
+ import { isBrowser } from "./is-browser.js";
2
2
  function isIframe() {
3
3
  return isBrowser() && window.self !== window.top;
4
4
  }
@@ -1,5 +1,5 @@
1
- import { isBrowser } from "./is-browser";
2
- import { isEditing } from "./is-editing";
1
+ import { isBrowser } from "./is-browser.js";
2
+ import { isEditing } from "./is-editing.js";
3
3
  function isPreviewing() {
4
4
  if (!isBrowser()) {
5
5
  return false;
@@ -1,4 +1,4 @@
1
- import { onChange } from "./on-change";
1
+ import { onChange } from "./on-change.js";
2
2
  test("onChange can observe a shallow change", () => {
3
3
  let changeHappend = false;
4
4
  const obj = onChange({ foo: "hi" }, () => changeHappend = true);
@@ -1,4 +1,4 @@
1
- import { isPreviewing } from "./is-previewing";
1
+ import { isPreviewing } from "./is-previewing.js";
2
2
  function previewingModelName() {
3
3
  if (!isPreviewing()) {
4
4
  return null;
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { isBrowser } from "./is-browser";
20
+ import { isBrowser } from "./is-browser.js";
21
21
  const components = {};
22
22
  function registerComponent(component, info) {
23
23
  var _a;
@@ -1,4 +1,4 @@
1
- import { isBrowser } from "./is-browser";
1
+ import { isBrowser } from "./is-browser.js";
2
2
  const registry = {};
3
3
  function register(type, info) {
4
4
  let typeList = registry[type];
@@ -1,4 +1,4 @@
1
- import { isBrowser } from "./is-browser";
1
+ import { isBrowser } from "./is-browser.js";
2
2
  const settings = {};
3
3
  function setEditorSettings(newSettings) {
4
4
  if (isBrowser()) {
@@ -1,4 +1,4 @@
1
- import { set } from "./set";
1
+ import { set } from "./set.js";
2
2
  test("can shallow set a property", () => {
3
3
  const obj = { foo: "bar" };
4
4
  set(obj, "foo", "baz");
@@ -1,6 +1,6 @@
1
- import { TARGET } from "../constants/target";
2
- import { isBrowser } from "./is-browser";
3
- import { isEditing } from "./is-editing";
1
+ import { TARGET } from "../constants/target.js";
2
+ import { isBrowser } from "./is-browser.js";
3
+ import { isEditing } from "./is-editing.js";
4
4
  function track(event, properties) {
5
5
  if (isEditing()) {
6
6
  return;
@@ -1,11 +1,11 @@
1
- import { default as default2 } from "../blocks/columns";
2
- import { default as default3 } from "../blocks/image";
3
- import { default as default4 } from "../blocks/text";
4
- import { default as default5 } from "../blocks/video";
5
- import { default as default6 } from "../blocks/symbol";
6
- import { default as default7 } from "../blocks/button";
7
- import { default as default8 } from "../blocks/section";
8
- import { default as default9 } from "../blocks/fragment";
1
+ import { default as default2 } from "../blocks/columns/index.js";
2
+ import { default as default3 } from "../blocks/image/index.js";
3
+ import { default as default4 } from "../blocks/text/index.js";
4
+ import { default as default5 } from "../blocks/video/index.js";
5
+ import { default as default6 } from "../blocks/symbol/index.js";
6
+ import { default as default7 } from "../blocks/button/index.js";
7
+ import { default as default8 } from "../blocks/section/index.js";
8
+ import { default as default9 } from "../blocks/fragment/index.js";
9
9
  import { default as default10 } from "../components/render-content/render-content.svelte";
10
10
  export {
11
11
  default7 as Button,
package/src/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import "./index-helpers/top-of-file";
2
- import "./scripts/init-editing";
3
- export * from "./index-helpers/blocks-exports";
4
- export * from "./functions/is-editing";
5
- export * from "./functions/is-previewing";
6
- export * from "./functions/register-component";
7
- export * from "./functions/register";
8
- export * from "./functions/set-editor-settings";
9
- export * from "./functions/get-content";
10
- export * from "./functions/get-builder-search-params";
1
+ import "./index-helpers/top-of-file.js";
2
+ import "./scripts/init-editing.js";
3
+ export * from "./index-helpers/blocks-exports.js";
4
+ export * from "./functions/is-editing.js";
5
+ export * from "./functions/is-previewing.js";
6
+ export * from "./functions/register-component.js";
7
+ export * from "./functions/register.js";
8
+ export * from "./functions/set-editor-settings.js";
9
+ export * from "./functions/get-content/index.js";
10
+ export * from "./functions/get-builder-search-params/index.js";
@@ -1,7 +1,7 @@
1
- import { TARGET } from "../constants/target";
2
- import { isBrowser } from "../functions/is-browser";
3
- import { isEditing } from "../functions/is-editing";
4
- import { register } from "../functions/register";
1
+ import { TARGET } from "../constants/target.js";
2
+ import { isBrowser } from "../functions/is-browser.js";
3
+ import { isEditing } from "../functions/is-editing.js";
4
+ import { register } from "../functions/register.js";
5
5
  const registerInsertMenu = () => {
6
6
  register("insertMenu", {
7
7
  name: "_default",