@weaverse/core 0.2.3 → 0.3.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.
package/dist/core.esm.js DELETED
@@ -1,269 +0,0 @@
1
- import fetch from 'isomorphic-unfetch';
2
- import { env } from 'process';
3
-
4
- var isReactNative = typeof navigator === 'object' && navigator.product === 'ReactNative';
5
- var isBrowser = typeof window !== 'undefined' && !isReactNative;
6
- var isIframe = isBrowser && window.top !== window.self;
7
-
8
- // TODO: Implement Weaverse SDK class
9
- // using stitches core only for framework-agnostic code
10
-
11
- var stitches = /*#__PURE__*/require('@stitches/core');
12
-
13
- var Weaverse = /*#__PURE__*/function () {
14
- /**
15
- * constructor
16
- * @param appUrl {string} Weaverse base URL that can provide by user/developer. for local development, use localhost:3000
17
- * @param projectKey {string} Weaverse project key to access project data via API
18
- * @param projectData {ProjectDataType} Weaverse project data, by default, user can provide project data via React Component.
19
- */
20
- function Weaverse(_temp) {
21
- var _ref = _temp === void 0 ? {} : _temp,
22
- appUrl = _ref.appUrl,
23
- projectKey = _ref.projectKey,
24
- projectData = _ref.projectData;
25
-
26
- /**
27
- * For storing, registering element React component from Weaverse or created by user/developer
28
- * @type {Map<string, React.Component>}
29
- */
30
- this.elementInstances = new Map();
31
- /**
32
- * list of element/items store to provide data, handle state update, state sharing, etc.
33
- * @type {Map<string, any>}
34
- */
35
-
36
- this.itemInstances = new Map();
37
- /**
38
- * Weaverse base URL that can provide by user/developer. for local development, use localhost:3000
39
- * @type {string}
40
- */
41
-
42
- this.appUrl = env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'https://weaverse.io';
43
- /**
44
- * Weaverse project key to access project data via API
45
- * @type {string}
46
- */
47
-
48
- this.projectKey = '';
49
- /**
50
- * Weaverse project data, by default, user can provide project data via React Component:
51
- * <WeaverseRoot defaultData={projectData} /> it will be used to server-side rendering
52
- */
53
-
54
- this.projectData = {
55
- items: []
56
- };
57
- /**
58
- * storing subscribe callback function for any component that want to listen to the change of WeaverseRoot
59
- * @type {Map<string, (data: any) => void>}
60
- */
61
-
62
- this.listeners = new Set();
63
- /**
64
- * check whether the sdk is inEditor or not
65
- * if isEditor is true, it means the sdk is inEditor mode, render the editor UI
66
- * else render the preview UI, plain HTML + CSS + React hydrate
67
- * @type {boolean}
68
- */
69
-
70
- this.isEditor = false;
71
- this.appUrl = appUrl || this.appUrl;
72
- this.projectKey = projectKey || this.projectKey;
73
- projectData && (this.projectData = projectData);
74
- this.init();
75
- }
76
- /**
77
- * register the custom React Component to Weaverse, store it into Weaverse.elementInstances
78
- * @param name {string} unique name of the custom React Component
79
- * @param element {React.Component} custom React Component
80
- */
81
-
82
-
83
- var _proto = Weaverse.prototype;
84
-
85
- _proto.registerElement = function registerElement(name, element) {
86
- this.elementInstances.set(name, element);
87
- };
88
-
89
- _proto.init = function init() {
90
- // init the stitches instance
91
- this.stitchesInstance = stitches.createStitches({
92
- prefix: 'weaverse',
93
- media: {
94
- bp1: '(min-width: 640px)',
95
- bp2: '(max-width: 768px)',
96
- bp3: '(min-width: 1024px)'
97
- }
98
- });
99
- this.loadStudio();
100
- };
101
-
102
- _proto.loadStudio = function loadStudio() {
103
- var _this = this;
104
-
105
- if (isIframe) {
106
- var initStudio = function initStudio() {
107
- var StudioBridge = window.WeaverseStudioBridge;
108
- _this.studioBridge = new StudioBridge(_this);
109
-
110
- _this.studioBridge.subscribeMessageEvent();
111
-
112
- _this.triggerUpdate();
113
-
114
- console.log('studio bridge initialized', _this.studioBridge);
115
- };
116
-
117
- window.addEventListener('message', function (e) {
118
- var _e$data;
119
-
120
- if (((_e$data = e.data) == null ? void 0 : _e$data.type) === 'weaverse.editor.ready') {
121
- _this.isEditor = true;
122
-
123
- if (!window.WeaverseStudioBridge) {
124
- // load studio bridge script by url: https://weaverse.io/assets/studio/studio-bridge.js
125
- var studioBridgeScript = document.createElement('script');
126
- studioBridgeScript.src = _this.appUrl + "/assets/studio/studio-bridge.js";
127
- studioBridgeScript.onload = initStudio;
128
- document.body.appendChild(studioBridgeScript);
129
- } else {
130
- initStudio();
131
- }
132
- }
133
- });
134
- }
135
- };
136
-
137
- _proto.subscribe = function subscribe(fn) {
138
- this.listeners.add(fn);
139
- };
140
-
141
- _proto.unsubscribe = function unsubscribe(fn) {
142
- this.listeners["delete"](fn);
143
- };
144
-
145
- _proto.triggerUpdate = function triggerUpdate() {
146
- this.listeners.forEach(function (fn) {
147
- return fn();
148
- });
149
- this.triggerEditorUpdate();
150
- }
151
- /**
152
- * fetch data from Weaverse API (https://weaverse.io/api/v1/projects/:projectKey)
153
- */
154
- ;
155
-
156
- _proto.fetchProjectData = function fetchProjectData() {
157
- return fetch(this.appUrl + ("/api/public/" + this.projectKey)).then(function (r) {
158
- return r.json();
159
- })["catch"](console.error);
160
- }
161
- /**
162
- * fetch and update the project data, then trigger update to re-render the WeaverseRoot
163
- */
164
- ;
165
-
166
- _proto.updateProjectData = function updateProjectData() {
167
-
168
- console.log('this.projectData', this.projectData);
169
- this.initItemData();
170
- this.triggerUpdate();
171
- return;
172
- };
173
-
174
- _proto.triggerEditorUpdate = function triggerEditorUpdate(type) {
175
- if (type === void 0) {
176
- type = 'weaverse.workspace.init';
177
- }
178
-
179
- if (this.isEditor) {
180
- var _window$top;
181
-
182
- (_window$top = window.top) == null ? void 0 : _window$top.postMessage({
183
- type: type,
184
- payload: {
185
- projectKey: this.projectKey,
186
- projectData: this.projectData
187
- }
188
- }, '*');
189
- }
190
- };
191
-
192
- _proto.initItemData = function initItemData() {
193
- var _this3 = this;
194
-
195
- var data = this.projectData;
196
-
197
- if (data.items) {
198
- data.items.forEach(function (item) {
199
- var itemStore = _this3.itemInstances.get(item.id) || new WeaverseItemStore(item, _this3);
200
-
201
- _this3.itemInstances.set(item.id, itemStore);
202
- });
203
- }
204
- };
205
-
206
- return Weaverse;
207
- }();
208
- /**
209
- * WeaverseItemStore is a store for Weaverse item, it can be used to subscribe/update the item data
210
- * @param itemData {ProjectDataItemType} Weaverse item data
211
- * @param weaverse {Weaverse} Weaverse instance
212
- * Usage:
213
- * ```jsx
214
- * useEffect(() => {
215
- * let handleUpdate = (update: any) => {
216
- * setData({...update})
217
- * }
218
- * itemInstance.subscribe(handleUpdate)
219
- * return () => {
220
- * itemInstance.unsubscribe(handleUpdate)
221
- * }
222
- * }, [])
223
- * ```
224
- */
225
-
226
- var WeaverseItemStore = function WeaverseItemStore(itemData, weaverse) {
227
- var _this4 = this;
228
-
229
- if (itemData === void 0) {
230
- itemData = {};
231
- }
232
-
233
- this.data = {};
234
- this.listeners = new Set();
235
- this.ref = {
236
- current: null
237
- };
238
-
239
- this.setData = function (data) {
240
- _this4.data = Object.assign(_this4.data, data);
241
-
242
- _this4.triggerUpdate();
243
- };
244
-
245
- this.subscribe = function (fn) {
246
- _this4.listeners.add(fn);
247
- };
248
-
249
- this.unsubscribe = function (fn) {
250
- _this4.listeners["delete"](fn);
251
- };
252
-
253
- this.triggerUpdate = function () {
254
- _this4.listeners.forEach(function (fn) {
255
- return fn(_this4.data);
256
- });
257
- };
258
-
259
- this.data = itemData;
260
- var _itemData = itemData,
261
- type = _itemData.type;
262
-
263
- if (type) {
264
- this.Component = weaverse.elementInstances.get(type);
265
- }
266
- };
267
-
268
- export { Weaverse, WeaverseItemStore, isBrowser, isIframe, isReactNative };
269
- //# sourceMappingURL=core.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.esm.js","sources":["../src/utils/index.ts","../src/core.ts"],"sourcesContent":["export const isReactNative = typeof navigator === 'object' && navigator.product === 'ReactNative'\nexport const isBrowser = typeof window !== 'undefined' && !isReactNative\nexport const isIframe = isBrowser && window.top !== window.self","// TODO: Implement Weaverse SDK class\n// Only core code is implemented here, avoid importing other packages,\n// the core code should be framework agnostic, no react, vue, angular, etc.\nimport fetch from 'isomorphic-unfetch'\nimport * as process from 'process'\nimport Stitches from '@stitches/core/types/stitches'\nimport {isIframe} from './utils'\n// stitches problem, we should use require instead of import\n// using stitches core only for framework-agnostic code\nlet stitches = require('@stitches/core')\n\n\nexport interface ProjectDataItemType {\n type: string\n name?: string\n id: string | number\n description?: string\n childIds?: Array<string | number>\n css?: {\n [key: string]: string\n }\n}\n\nexport interface ProjectDataType {\n items: ProjectDataItemType[]\n}\n\n\nexport type WeaverseType = {\n [key: string]: any\n appUrl?: string,\n projectKey?: string,\n projectData?: ProjectDataType\n}\n\n\nexport class Weaverse {\n /**\n * For storing, registering element React component from Weaverse or created by user/developer\n * @type {Map<string, React.Component>}\n */\n elementInstances = new Map<string, any>()\n /**\n * list of element/items store to provide data, handle state update, state sharing, etc.\n * @type {Map<string, any>}\n */\n itemInstances = new Map<string | number, WeaverseItemStore>()\n /**\n * Weaverse base URL that can provide by user/developer. for local development, use localhost:3000\n * @type {string}\n */\n appUrl: string = process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : 'https://weaverse.io'\n /**\n * Weaverse project key to access project data via API\n * @type {string}\n */\n projectKey: string = ''\n /**\n * Weaverse project data, by default, user can provide project data via React Component:\n * <WeaverseRoot defaultData={projectData} /> it will be used to server-side rendering\n */\n projectData: ProjectDataType = {\n items: []\n }\n /**\n * storing subscribe callback function for any component that want to listen to the change of WeaverseRoot\n * @type {Map<string, (data: any) => void>}\n */\n listeners: Set<any> = new Set()\n /**\n * check whether the sdk is inEditor or not\n * if isEditor is true, it means the sdk is inEditor mode, render the editor UI\n * else render the preview UI, plain HTML + CSS + React hydrate\n * @type {boolean}\n */\n isEditor = false\n /**\n * stitches instance for handling CSS stylesheet, media, theme for Weaverse project\n */\n stitchesInstance: Stitches | any\n\n studioBridge?: any\n\n /**\n * constructor\n * @param appUrl {string} Weaverse base URL that can provide by user/developer. for local development, use localhost:3000\n * @param projectKey {string} Weaverse project key to access project data via API\n * @param projectData {ProjectDataType} Weaverse project data, by default, user can provide project data via React Component.\n */\n constructor({appUrl, projectKey, projectData}: WeaverseType = {}) {\n this.appUrl = appUrl || this.appUrl\n this.projectKey = projectKey || this.projectKey\n projectData && (this.projectData = projectData)\n this.init()\n }\n\n /**\n * register the custom React Component to Weaverse, store it into Weaverse.elementInstances\n * @param name {string} unique name of the custom React Component\n * @param element {React.Component} custom React Component\n */\n registerElement(name: string, element: any) {\n this.elementInstances.set(name, element)\n }\n\n init() {\n // init the stitches instance\n this.stitchesInstance = stitches.createStitches(\n {\n prefix: 'weaverse',\n media: {\n bp1: '(min-width: 640px)',\n bp2: '(max-width: 768px)',\n bp3: '(min-width: 1024px)'\n }\n }\n )\n this.loadStudio()\n }\n\n loadStudio() {\n if (isIframe) {\n let initStudio = () => {\n let StudioBridge = window.WeaverseStudioBridge\n this.studioBridge = new StudioBridge(this)\n this.studioBridge.subscribeMessageEvent()\n this.triggerUpdate()\n console.log('studio bridge initialized', this.studioBridge)\n }\n window.addEventListener('message', e => {\n if (e.data?.type === 'weaverse.editor.ready') {\n this.isEditor = true\n if (!window.WeaverseStudioBridge) {\n // load studio bridge script by url: https://weaverse.io/assets/studio/studio-bridge.js\n const studioBridgeScript = document.createElement('script')\n studioBridgeScript.src = `${this.appUrl}/assets/studio/studio-bridge.js`\n studioBridgeScript.onload = initStudio\n document.body.appendChild(studioBridgeScript)\n } else {\n initStudio()\n }\n }\n })\n }\n }\n\n subscribe(fn: any) {\n this.listeners.add(fn)\n }\n\n unsubscribe(fn: any) {\n this.listeners.delete(fn)\n }\n\n triggerUpdate() {\n this.listeners.forEach(fn => fn())\n this.triggerEditorUpdate()\n }\n\n /**\n * fetch data from Weaverse API (https://weaverse.io/api/v1/projects/:projectKey)\n */\n fetchProjectData() {\n return fetch(this.appUrl + `/api/public/${this.projectKey}`).then(r => r.json()).catch(console.error)\n }\n\n /**\n * fetch and update the project data, then trigger update to re-render the WeaverseRoot\n */\n updateProjectData() {\n console.log('this.projectData', this.projectData)\n this.initItemData()\n this.triggerUpdate()\n return\n if (this.projectKey) {\n this.fetchProjectData().then(data => {\n if (data) {\n this.projectData = data\n this.initItemData()\n this.triggerUpdate()\n }\n }).catch(err => {\n console.error(err)\n })\n }\n }\n\n\n triggerEditorUpdate(type = 'weaverse.workspace.init') {\n if (this.isEditor) {\n window.top?.postMessage({\n type, payload: {\n projectKey: this.projectKey,\n projectData: this.projectData\n }\n }, '*')\n }\n }\n\n initItemData() {\n let data = this.projectData\n if (data.items) {\n data.items.forEach(item => {\n let itemStore = this.itemInstances.get(item.id) || new WeaverseItemStore(item, this)\n this.itemInstances.set(item.id, itemStore)\n })\n }\n }\n}\n\n/**\n * WeaverseItemStore is a store for Weaverse item, it can be used to subscribe/update the item data\n * @param itemData {ProjectDataItemType} Weaverse item data\n * @param weaverse {Weaverse} Weaverse instance\n * Usage:\n * ```jsx\n * useEffect(() => {\n * let handleUpdate = (update: any) => {\n * setData({...update})\n * }\n * itemInstance.subscribe(handleUpdate)\n * return () => {\n * itemInstance.unsubscribe(handleUpdate)\n * }\n * }, [])\n * ```\n */\nexport class WeaverseItemStore {\n data: any = {}\n listeners: Set<any> = new Set()\n Component: any\n ref: any = {\n current: null\n }\n\n constructor(itemData: any = {}, weaverse: Weaverse) {\n this.data = itemData\n let {type} = itemData\n if (type) {\n this.Component = weaverse.elementInstances.get(type)\n }\n }\n\n setData = (data: any) => {\n this.data = Object.assign(this.data, data)\n this.triggerUpdate()\n }\n\n subscribe = (fn: any) => {\n this.listeners.add(fn)\n }\n\n unsubscribe = (fn: any) => {\n this.listeners.delete(fn)\n }\n\n triggerUpdate = () => {\n this.listeners.forEach(fn => {\n return fn(this.data)\n })\n }\n}"],"names":["isReactNative","navigator","product","isBrowser","window","isIframe","top","self","stitches","require","Weaverse","appUrl","projectKey","projectData","Map","process","NODE_ENV","items","Set","init","registerElement","name","element","elementInstances","set","stitchesInstance","createStitches","prefix","media","bp1","bp2","bp3","loadStudio","initStudio","StudioBridge","WeaverseStudioBridge","studioBridge","subscribeMessageEvent","triggerUpdate","console","log","addEventListener","e","data","type","isEditor","studioBridgeScript","document","createElement","src","onload","body","appendChild","subscribe","fn","listeners","add","unsubscribe","forEach","triggerEditorUpdate","fetchProjectData","fetch","then","r","json","error","updateProjectData","initItemData","postMessage","payload","item","itemStore","itemInstances","get","id","WeaverseItemStore","itemData","weaverse","current","Object","assign","Component"],"mappings":";;;IAAaA,aAAa,GAAG,OAAOC,SAAP,KAAqB,QAArB,IAAiCA,SAAS,CAACC,OAAV,KAAsB;IACvEC,SAAS,GAAG,OAAOC,MAAP,KAAkB,WAAlB,IAAiC,CAACJ;IAC9CK,QAAQ,GAAGF,SAAS,IAAIC,MAAM,CAACE,GAAP,KAAeF,MAAM,CAACG;;ACF3D;AACA,AAOA;;AACA,IAAIC,QAAQ,gBAAGC,OAAO,CAAC,gBAAD,CAAtB;;AA2BA,IAAaC,QAAb;AA+CE;;;;;;AAMA;kCAA8D;QAAjDC,cAAAA;QAAQC,kBAAAA;QAAYC,mBAAAA;;AApDjC;;;;AAIA,yBAAA,GAAmB,IAAIC,GAAJ,EAAnB;AACA;;;;;AAIA,sBAAA,GAAgB,IAAIA,GAAJ,EAAhB;AACA;;;;;AAIA,eAAA,GAAiBC,GAAA,CAAYC,QAAZ,KAAyB,aAAzB,GAAyC,uBAAzC,GAAmE,qBAApF;AACA;;;;;AAIA,mBAAA,GAAqB,EAArB;AACA;;;;;AAIA,oBAAA,GAA+B;AAC7BC,MAAAA,KAAK,EAAE;AADsB,KAA/B;AAGA;;;;;AAIA,kBAAA,GAAsB,IAAIC,GAAJ,EAAtB;AACA;;;;;;;AAMA,iBAAA,GAAW,KAAX;AAeE,SAAKP,MAAL,GAAcA,MAAM,IAAI,KAAKA,MAA7B;AACA,SAAKC,UAAL,GAAkBA,UAAU,IAAI,KAAKA,UAArC;AACAC,IAAAA,WAAW,KAAK,KAAKA,WAAL,GAAmBA,WAAxB,CAAX;AACA,SAAKM,IAAL;AACD;AAED;;;;;;;AA5DF;;AAAA,SAiEEC,eAjEF,GAiEE,yBAAgBC,IAAhB,EAA8BC,OAA9B;AACE,SAAKC,gBAAL,CAAsBC,GAAtB,CAA0BH,IAA1B,EAAgCC,OAAhC;AACD,GAnE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,MAAIA,IAAJ,EAAU;AACR,SAAKqC,SAAL,GAAiBJ,QAAQ,CAACtD,gBAAT,CAA0BkD,GAA1B,CAA8B7B,IAA9B,CAAjB;AACD;AACF,CAdH;;;;"}
@@ -1,3 +0,0 @@
1
- export declare const isReactNative: boolean;
2
- export declare const isBrowser: boolean;
3
- export declare const isIframe: boolean;
@@ -1 +0,0 @@
1
- declare const loadScript: (url: string) => Promise<unknown>;