@symbo.ls/create 2.11.508 → 2.11.512

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.
@@ -0,0 +1,14 @@
1
+ import { scratchUtils, scratchSystem, set } from "@symbo.ls/scratch";
2
+ export * from "@domql/utils";
3
+ export * from "@symbo.ls/utils";
4
+ import { init, reinit, applyCSS } from "@symbo.ls/init";
5
+ export * from "@domql/report";
6
+ export * from "@domql/router";
7
+ export {
8
+ applyCSS,
9
+ init,
10
+ reinit,
11
+ scratchSystem,
12
+ scratchUtils,
13
+ set
14
+ };
package/package.json CHANGED
@@ -1,45 +1,44 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.508",
3
+ "version": "2.11.512",
4
4
  "license": "MIT",
5
- "gitHead": "e020dc57f9b91184b88d34094575040f7bdf84f7",
6
- "files": [
7
- "src",
8
- "dist"
9
- ],
10
- "repository": "https://github.com/symbo-ls/scratch",
5
+ "gitHead": "72e3686d3c934501b7bffb459ce6d0d271bc0f8d",
11
6
  "type": "module",
12
7
  "module": "src/index.js",
8
+ "main": "src/index.js",
13
9
  "unpkg": "dist/iife/index.js",
14
10
  "jsdelivr": "dist/iife/index.js",
15
- "main": "src/index.js",
16
11
  "exports": {
17
12
  ".": {
18
- "kalduna": "./src/index.js",
19
- "default": "./dist/cjs/index.js"
13
+ "default": "./dist/esm/index.js",
14
+ "import": "./dist/esm/index.js",
15
+ "require": "./dist/cjs/index.js"
20
16
  }
21
17
  },
22
18
  "source": "src/index.js",
23
- "publishConfig": {},
19
+ "files": [
20
+ "src",
21
+ "dist"
22
+ ],
24
23
  "scripts": {
25
24
  "copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
26
- "build:esm": "npx esbuild ./src/*.js --target=es2017 --format=esm --outdir=dist/esm --loader:.svg=text",
27
- "build:cjs": "npx esbuild ./src/*.js --target=node16 --format=cjs --outdir=dist/cjs --loader:.svg=text",
28
- "build:cjs:bundle": "npx esbuild ./src/index.js --target=node16 --format=cjs --outdir=dist/cjs/bundle --loader:.svg=text --bundle --loader:.svg=empty",
29
- "build:iife": "npx esbuild ./src/index.js --target=es2017 --format=iife --outdir=dist/iife --loader:.svg=text --bundle --minify",
30
- "build": "npm run build:cjs; npm run build:cjs:bundle",
31
- "prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
25
+ "build:esm": "npx esbuild src/*.js --target=es2017 --format=esm --outdir=dist/esm",
26
+ "build:cjs": "npx esbuild src/*.js --target=node16 --format=cjs --outdir=dist/cjs",
27
+ "build:iife": "npx esbuild src/*.js --target=node16 --format=iife --outdir=dist/iife",
28
+ "build": "rimraf -I dist; npm run build:cjs; npm run build:esm",
29
+ "prepublish": "npm run build; npm run copy:package:cjs"
32
30
  },
33
31
  "dependencies": {
34
32
  "@domql/emotion": "^2.5.0",
33
+ "@domql/event": "^2.5.0",
35
34
  "@domql/report": "^2.5.0",
36
35
  "@domql/router": "^2.5.0",
37
- "@symbo.ls/fetch": "^2.11.475",
38
- "@symbo.ls/init": "^2.11.508",
39
- "@symbo.ls/scratch": "^2.11.504",
40
- "@symbo.ls/sync": "^2.11.508",
41
- "@symbo.ls/uikit": "^2.11.504",
42
- "@symbo.ls/utils": "^2.11.504",
36
+ "@symbo.ls/fetch": "^2.11.511",
37
+ "@symbo.ls/init": "^2.11.512",
38
+ "@symbo.ls/scratch": "^2.11.512",
39
+ "@symbo.ls/sync": "^2.11.512",
40
+ "@symbo.ls/uikit": "^2.11.512",
41
+ "@symbo.ls/utils": "^2.11.512",
43
42
  "domql": "^2.5.158"
44
43
  },
45
44
  "devDependencies": {
@@ -4,12 +4,12 @@ import DOM from 'domql'
4
4
  import * as uikit from '@symbo.ls/uikit'
5
5
 
6
6
  import { isString, isNode, isObject } from '@domql/utils'
7
+ import { initAnimationFrame } from '@domql/event'
7
8
  import { defaultDefine } from './define'
8
9
  import { initRouter } from './router'
9
10
  import { initializeExtend, initializeInspect, initializeNotifications, initializeSync } from './syncExtend'
10
11
 
11
12
  import {
12
- initAnimationFrame,
13
13
  prepareComponents,
14
14
  prepareDependencies,
15
15
  prepareDesignSystem,
@@ -63,7 +63,7 @@ export const createDomqlElement = async (app, ctx) => {
63
63
  app.state = ctx.state
64
64
  app.context = ctx
65
65
  app.data = app.data || {}
66
- app.data.frameListeners = initAnimationFrame()
66
+ app.data.frameListeners = initAnimationFrame(ctx)
67
67
 
68
68
  prepareRequire({
69
69
  functions: ctx.functions,
package/src/index.js CHANGED
@@ -23,7 +23,7 @@ export const create = (App, options = DEFAULT_CREATE_OPTIONS, optionsExternalFil
23
23
 
24
24
  popStateRouter(domqlApp, redefinedOptions)
25
25
 
26
- if (redefinedOptions.on && redefinedOptions.on.create) redefinedOptions.on.create(domqlApp, redefinedOptions)
26
+ if (redefinedOptions.on && redefinedOptions.on.create) redefinedOptions.on.create(domqlApp, domqlApp.state, domqlApp.context, redefinedOptions)
27
27
 
28
28
  return domqlApp
29
29
  }
@@ -47,7 +47,7 @@ export const createSync = async (App, options = DEFAULT_CREATE_OPTIONS, optionsE
47
47
  await fetchSync(key, redefinedOptions)
48
48
 
49
49
  const domqlApp = await createDomqlElement(App, redefinedOptions)
50
- if (redefinedOptions.on && redefinedOptions.on.create) await (redefinedOptions.on.create(domqlApp, redefinedOptions))
50
+ if (redefinedOptions.on && redefinedOptions.on.create) await (redefinedOptions.on.create(domqlApp, domqlApp.state, domqlApp.context, redefinedOptions))
51
51
 
52
52
  return domqlApp
53
53
  }
package/src/prepare.js CHANGED
@@ -171,27 +171,3 @@ export const preparePages = (app, context) => {
171
171
  return pages
172
172
  }, pages)
173
173
  }
174
-
175
- export const initAnimationFrame = () => {
176
- const frameListeners = new Set()
177
-
178
- function requestFrame () {
179
- // Iterate over frameListeners
180
- for (const element of frameListeners) {
181
- if (!document.body.contains(element.node)) {
182
- frameListeners.delete(element) // Remove if node has no parent
183
- } else {
184
- try {
185
- (element.on.frame || element.props.onFrame)(element, element.state, element.context)
186
- } catch (e) {
187
- console.warn(e)
188
- }
189
- }
190
- }
191
- window.requestAnimationFrame(requestFrame)
192
- }
193
-
194
- requestFrame()
195
-
196
- return frameListeners
197
- }