@cesdk/cesdk-js 1.72.0 → 1.72.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/assets/core/{cesdk-v1.72.0-4WZQ6X3Z.wasm → cesdk-v1.72.1-6DYQNDMR.wasm} +0 -0
- package/assets/core/{worker-host-v1.72.0.js → worker-host-v1.72.1.js} +1 -1
- package/assets/ui/stylesheets/cesdk.css +58 -37
- package/cesdk.umd.js +1 -1
- package/index.d.ts +9 -6
- package/index.js +1 -1
- package/package.json +2 -2
- package/integrations/react.d.ts +0 -182
- package/integrations/react.js +0 -1
- /package/assets/core/{cesdk-v1.72.0-MLEZSZ4D.data → cesdk-v1.72.1-MLEZSZ4D.data} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cesdk/cesdk-js",
|
|
3
|
-
"version": "1.72.
|
|
3
|
+
"version": "1.72.1",
|
|
4
4
|
"module": "./index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
41
41
|
"readme": "README.md",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@cesdk/engine": "1.72.
|
|
43
|
+
"@cesdk/engine": "1.72.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@angular/common": ">=14.0.0",
|
package/integrations/react.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import type CreativeEngine from '@cesdk/engine';
|
|
2
|
-
import type * as React_2 from 'react';
|
|
3
|
-
import type { Reaction } from '@cesdk/engine';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Takes a selector function and returns its result. The selector function will
|
|
7
|
-
* be re-run whenever the values returned by the engine api methods inside it change.
|
|
8
|
-
* If the value returned from the selector function changes, the component this hook
|
|
9
|
-
* is used in will be re-rendered.
|
|
10
|
-
*
|
|
11
|
-
* For determining whether a value has changed, objects are compared deeply,
|
|
12
|
-
* using lodash's isEqual function.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
*
|
|
16
|
-
* ```tsx
|
|
17
|
-
* function MyComponent() {
|
|
18
|
-
* // Get the engine instance from the context.
|
|
19
|
-
* // You could also pass it in via props.
|
|
20
|
-
* const engine = useEngine();
|
|
21
|
-
*
|
|
22
|
-
* const type = useEngineSelector(engine, () => {
|
|
23
|
-
* const selectedBlock = engine.block.findAllSelected()[0];
|
|
24
|
-
* return selectedBlock ? engine.block.getType(selectedBlock) : null;
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* return <div>Current block type {type}</div>
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param engine - An instance of the engine. This instance is passed to the selector
|
|
32
|
-
* @param selector - A method that retrieves values from the engine.
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
export declare function useEngineSelector<T>(engine: CreativeEngine, selector: (engine: CreativeEngine) => T, options?: {
|
|
37
|
-
/** A string that is used internally for debugging */
|
|
38
|
-
debugName?: string;
|
|
39
|
-
/**
|
|
40
|
-
* A method that compares two results of the selector
|
|
41
|
-
* and returns true if they are considered equal.
|
|
42
|
-
*/
|
|
43
|
-
equals?: (value: T, lastValue: T | undefined) => boolean;
|
|
44
|
-
}): T;
|
|
45
|
-
|
|
46
|
-
/** @public */
|
|
47
|
-
export declare function useEngineSelector<T>(engine: CreativeEngine | undefined, selector: (engine: CreativeEngine | undefined) => T, options?: {
|
|
48
|
-
/** A string that is used internally for debugging */
|
|
49
|
-
debugName?: string;
|
|
50
|
-
/**
|
|
51
|
-
* A method that compares two results of the selector
|
|
52
|
-
* and returns true if they are considered equal.
|
|
53
|
-
*/
|
|
54
|
-
equals?: (value: T, lastValue: T | undefined) => boolean;
|
|
55
|
-
}): T | undefined;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* A type helper for writing components that use the withEngine decorator.
|
|
59
|
-
*
|
|
60
|
-
* Makes it easier to export the props of your component without the `engine`
|
|
61
|
-
* prop that is already handled by the decorator.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```tsx
|
|
65
|
-
* import withEngine, { type WithEngine } from '@cesdk/engine/react'
|
|
66
|
-
*
|
|
67
|
-
* export interface MyProps {
|
|
68
|
-
* blockId: number;
|
|
69
|
-
* }
|
|
70
|
-
*
|
|
71
|
-
* const MyComponent = withEngine(function MyComponent({blockId, engine}: WithEngine<MyProps>) {
|
|
72
|
-
* return <div>Block {blockId} is of type {engine.block.getType(blockId)}</div>
|
|
73
|
-
* });
|
|
74
|
-
*
|
|
75
|
-
* export default Mycomponent;
|
|
76
|
-
*
|
|
77
|
-
* ```
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
80
|
-
export declare type WithEngine<T> = T & {
|
|
81
|
-
engine: CreativeEngine;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Higher-order component for use with ReactJS
|
|
86
|
-
*
|
|
87
|
-
* Wrap your component with this function to make it reactive to changes in the engine.
|
|
88
|
-
* Inside your component, access the engine API normally. Whenever the values returned
|
|
89
|
-
* by the engine API change, your component will be re-rendered.
|
|
90
|
-
*
|
|
91
|
-
* For determining whether a value has changed, objects are compared deeply,
|
|
92
|
-
* using lodash's isEqual function.
|
|
93
|
-
*
|
|
94
|
-
* This HOC needs access to a CreativeEngine instance.
|
|
95
|
-
* This instance can be providedin two ways:
|
|
96
|
-
*
|
|
97
|
-
* - As a prop called `engine`
|
|
98
|
-
* - Via a function called `useEngine` that is passed in via the options object.
|
|
99
|
-
* This function will be called during rendering to get a CreativeEngine instance.
|
|
100
|
-
* This is useful if you want to use the component in an app where the engine is
|
|
101
|
-
* available via the context, since you can use hooks inside the `useEngine` function.
|
|
102
|
-
*
|
|
103
|
-
* In both cases the engine instance will be passed to your decorated component
|
|
104
|
-
* via the `engine` prop.
|
|
105
|
-
*
|
|
106
|
-
* If you pass neither an `engine` prop nor provide a `useEngine` function,
|
|
107
|
-
* the component will
|
|
108
|
-
* - render normally
|
|
109
|
-
* - not be reactive to changes in the engine
|
|
110
|
-
* - receive `undefined` in the `engine` prop
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```tsx
|
|
114
|
-
* function MyComponent({engine}) {
|
|
115
|
-
* const selectedBlock = engine.block.findAllSelected()[0];
|
|
116
|
-
* const type = selectedBlock ? engine.block.getType(selectedBlock) : null;
|
|
117
|
-
* return <div>Current block type {type}</div>
|
|
118
|
-
* }
|
|
119
|
-
*
|
|
120
|
-
* const MyComponentWithEngine = withEngine(MyComponent)
|
|
121
|
-
*
|
|
122
|
-
* // When no `useEngine` is provided, you need to pass the engine in via props
|
|
123
|
-
* <MyComponentWithEngine engine={engine}/>
|
|
124
|
-
* ```
|
|
125
|
-
*
|
|
126
|
-
* If a function is provided via the `useEngine` option, that function will be used
|
|
127
|
-
* to retrieve the engine instance. This is useful if you want to use the component
|
|
128
|
-
* in an app where the engine is not available via the context.
|
|
129
|
-
*
|
|
130
|
-
* ```tsx
|
|
131
|
-
* import useEngine from './hooks/useEngine'
|
|
132
|
-
*
|
|
133
|
-
* function MyComponent({ engine }) {
|
|
134
|
-
* const selectedBlock = engine.block.findAllSelected()[0];
|
|
135
|
-
* const type = selectedBlock ? engine.block.getType(selectedBlock) : null;
|
|
136
|
-
* return <div>Current block type {type}</div>
|
|
137
|
-
* }
|
|
138
|
-
*
|
|
139
|
-
* const MyComponentWithEngine = withEngine(MyComponent, {useEngine})
|
|
140
|
-
*
|
|
141
|
-
* // Since `useEngine` has been provided, engine does not need to be passed in via props
|
|
142
|
-
* <MyComponentWithEngine/>
|
|
143
|
-
* ```
|
|
144
|
-
*
|
|
145
|
-
* ### Combining with `forwardRef`
|
|
146
|
-
*
|
|
147
|
-
* If you want to decorate a function with both `withEngine` and `forwardRef`,
|
|
148
|
-
* apply `withEngine` first, then `forwardRef`:
|
|
149
|
-
*
|
|
150
|
-
* ```tsx
|
|
151
|
-
* forwardRef(withEngine(MyComponent))
|
|
152
|
-
* ```
|
|
153
|
-
*
|
|
154
|
-
* @param Component - the component you want to make reactive
|
|
155
|
-
* @param options - If you pass `useEngine` in this object, that function will
|
|
156
|
-
* be called during rendering to obtain the engine instance.
|
|
157
|
-
* This instance will be passed to your component via the
|
|
158
|
-
* `engine` prop. Since `useEngine` is called during rendering,
|
|
159
|
-
* you can use hooks inside it to retrieve the engine instance
|
|
160
|
-
* from your app's context.
|
|
161
|
-
*
|
|
162
|
-
* @public
|
|
163
|
-
*/
|
|
164
|
-
export declare function withEngine<P extends {
|
|
165
|
-
engine?: CreativeEngine;
|
|
166
|
-
}, O extends WithEngineOptions, R>(Component: React_2.ForwardRefRenderFunction<R, P>, options?: O): O extends {
|
|
167
|
-
useEngine: () => CreativeEngine;
|
|
168
|
-
} ? React_2.ForwardRefRenderFunction<R, Omit<P, 'engine'>> : React_2.ForwardRefRenderFunction<R, P>;
|
|
169
|
-
|
|
170
|
-
/** @public */
|
|
171
|
-
export declare function withEngine<P extends {
|
|
172
|
-
engine?: CreativeEngine;
|
|
173
|
-
}, O extends WithEngineOptions>(Component: React_2.FunctionComponent<P>, options?: O): O extends {
|
|
174
|
-
useEngine: () => CreativeEngine;
|
|
175
|
-
} ? React_2.FunctionComponent<Omit<P, 'engine'>> : React_2.FunctionComponent<P>;
|
|
176
|
-
|
|
177
|
-
declare interface WithEngineOptions<E = CreativeEngine> {
|
|
178
|
-
debugName?: string;
|
|
179
|
-
useEngine?: () => E;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export { }
|
package/integrations/react.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e,t,o,r=Object.create,s=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,d=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},i=d({"../../../node_modules/lodash/_listCacheClear.js"(e,t){t.exports=function(){this.__data__=[],this.size=0}}}),c=d({"../../../node_modules/lodash/eq.js"(e,t){t.exports=function(e,t){return e===t||e!=e&&t!=t}}}),_=d({"../../../node_modules/lodash/_assocIndexOf.js"(e,t){var o=c();t.exports=function(e,t){for(var r=e.length;r--;)if(o(e[r][0],t))return r;return-1}}}),p=d({"../../../node_modules/lodash/_listCacheDelete.js"(e,t){var o=_(),r=Array.prototype.splice;t.exports=function(e){var t=this.__data__,s=o(t,e);return!(s<0)&&(s==t.length-1?t.pop():r.call(t,s,1),--this.size,!0)}}}),h=d({"../../../node_modules/lodash/_listCacheGet.js"(e,t){var o=_();t.exports=function(e){var t=this.__data__,r=o(t,e);return r<0?void 0:t[r][1]}}}),f=d({"../../../node_modules/lodash/_listCacheHas.js"(e,t){var o=_();t.exports=function(e){return o(this.__data__,e)>-1}}}),j=d({"../../../node_modules/lodash/_listCacheSet.js"(e,t){var o=_();t.exports=function(e,t){var r=this.__data__,s=o(r,e);return s<0?(++this.size,r.push([e,t])):r[s][1]=t,this}}}),v=d({"../../../node_modules/lodash/_ListCache.js"(e,t){var o=i(),r=p(),s=h(),n=f(),a=j();function u(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=o,u.prototype.delete=r,u.prototype.get=s,u.prototype.has=n,u.prototype.set=a,t.exports=u}}),b=d({"../../../node_modules/lodash/_stackClear.js"(e,t){var o=v();t.exports=function(){this.__data__=new o,this.size=0}}}),y=d({"../../../node_modules/lodash/_stackDelete.js"(e,t){t.exports=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}}}),m=d({"../../../node_modules/lodash/_stackGet.js"(e,t){t.exports=function(e){return this.__data__.get(e)}}}),x=d({"../../../node_modules/lodash/_stackHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),g=d({"../../../node_modules/lodash/_freeGlobal.js"(e,t){var o="object"==typeof global&&global&&global.Object===Object&&global;t.exports=o}}),O=d({"../../../node_modules/lodash/_root.js"(e,t){var o=g(),r="object"==typeof self&&self&&self.Object===Object&&self,s=o||r||Function("return this")();t.exports=s}}),w=d({"../../../node_modules/lodash/_Symbol.js"(e,t){var o=O().Symbol;t.exports=o}}),A=d({"../../../node_modules/lodash/_getRawTag.js"(e,t){var o=w(),r=Object.prototype,s=r.hasOwnProperty,n=r.toString,a=o?o.toStringTag:void 0;t.exports=function(e){var t=s.call(e,a),o=e[a];try{e[a]=void 0;var r=!0}catch(e){}var u=n.call(e);return r&&(t?e[a]=o:delete e[a]),u}}}),S=d({"../../../node_modules/lodash/_objectToString.js"(e,t){var o=Object.prototype.toString;t.exports=function(e){return o.call(e)}}}),k=d({"../../../node_modules/lodash/_baseGetTag.js"(e,t){var o=w(),r=A(),s=S(),n=o?o.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":n&&n in Object(e)?r(e):s(e)}}}),z=d({"../../../node_modules/lodash/isObject.js"(e,t){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}}),P=d({"../../../node_modules/lodash/isFunction.js"(e,t){var o=k(),r=z();t.exports=function(e){if(!r(e))return!1;var t=o(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}}}),C=d({"../../../node_modules/lodash/_coreJsData.js"(e,t){var o=O()["__core-js_shared__"];t.exports=o}}),T=d({"../../../node_modules/lodash/_isMasked.js"(e,t){var o,r=C(),s=(o=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"";t.exports=function(e){return!!s&&s in e}}}),D=d({"../../../node_modules/lodash/_toSource.js"(e,t){var o=Function.prototype.toString;t.exports=function(e){if(null!=e){try{return o.call(e)}catch(e){}try{return e+""}catch(e){}}return""}}}),E=d({"../../../node_modules/lodash/_baseIsNative.js"(e,t){var o=P(),r=T(),s=z(),n=D(),a=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,d=u.toString,i=l.hasOwnProperty,c=RegExp("^"+d.call(i).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(e){return!(!s(e)||r(e))&&(o(e)?c:a).test(n(e))}}}),I=d({"../../../node_modules/lodash/_getValue.js"(e,t){t.exports=function(e,t){return null==e?void 0:e[t]}}}),M=d({"../../../node_modules/lodash/_getNative.js"(e,t){var o=E(),r=I();t.exports=function(e,t){var s=r(e,t);return o(s)?s:void 0}}}),q=d({"../../../node_modules/lodash/_Map.js"(e,t){var o=M()(O(),"Map");t.exports=o}}),F=d({"../../../node_modules/lodash/_nativeCreate.js"(e,t){var o=M()(Object,"create");t.exports=o}}),N=d({"../../../node_modules/lodash/_hashClear.js"(e,t){var o=F();t.exports=function(){this.__data__=o?o(null):{},this.size=0}}}),L=d({"../../../node_modules/lodash/_hashDelete.js"(e,t){t.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}}}),B=d({"../../../node_modules/lodash/_hashGet.js"(e,t){var o=F(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;if(o){var s=t[e];return"__lodash_hash_undefined__"===s?void 0:s}return r.call(t,e)?t[e]:void 0}}}),U=d({"../../../node_modules/lodash/_hashHas.js"(e,t){var o=F(),r=Object.prototype.hasOwnProperty;t.exports=function(e){var t=this.__data__;return o?void 0!==t[e]:r.call(t,e)}}}),G=d({"../../../node_modules/lodash/_hashSet.js"(e,t){var o=F();t.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=o&&void 0===t?"__lodash_hash_undefined__":t,this}}}),$=d({"../../../node_modules/lodash/_Hash.js"(e,t){var o=N(),r=L(),s=B(),n=U(),a=G();function u(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=o,u.prototype.delete=r,u.prototype.get=s,u.prototype.has=n,u.prototype.set=a,t.exports=u}}),H=d({"../../../node_modules/lodash/_mapCacheClear.js"(e,t){var o=$(),r=v(),s=q();t.exports=function(){this.size=0,this.__data__={hash:new o,map:new(s||r),string:new o}}}}),K=d({"../../../node_modules/lodash/_isKeyable.js"(e,t){t.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}}}),R=d({"../../../node_modules/lodash/_getMapData.js"(e,t){var o=K();t.exports=function(e,t){var r=e.__data__;return o(t)?r["string"==typeof t?"string":"hash"]:r.map}}}),V=d({"../../../node_modules/lodash/_mapCacheDelete.js"(e,t){var o=R();t.exports=function(e){var t=o(this,e).delete(e);return this.size-=t?1:0,t}}}),W=d({"../../../node_modules/lodash/_mapCacheGet.js"(e,t){var o=R();t.exports=function(e){return o(this,e).get(e)}}}),J=d({"../../../node_modules/lodash/_mapCacheHas.js"(e,t){var o=R();t.exports=function(e){return o(this,e).has(e)}}}),Q=d({"../../../node_modules/lodash/_mapCacheSet.js"(e,t){var o=R();t.exports=function(e,t){var r=o(this,e),s=r.size;return r.set(e,t),this.size+=r.size==s?0:1,this}}}),X=d({"../../../node_modules/lodash/_MapCache.js"(e,t){var o=H(),r=V(),s=W(),n=J(),a=Q();function u(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=o,u.prototype.delete=r,u.prototype.get=s,u.prototype.has=n,u.prototype.set=a,t.exports=u}}),Y=d({"../../../node_modules/lodash/_stackSet.js"(e,t){var o=v(),r=q(),s=X();t.exports=function(e,t){var n=this.__data__;if(n instanceof o){var a=n.__data__;if(!r||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new s(a)}return n.set(e,t),this.size=n.size,this}}}),Z=d({"../../../node_modules/lodash/_Stack.js"(e,t){var o=v(),r=b(),s=y(),n=m(),a=x(),u=Y();function l(e){var t=this.__data__=new o(e);this.size=t.size}l.prototype.clear=r,l.prototype.delete=s,l.prototype.get=n,l.prototype.has=a,l.prototype.set=u,t.exports=l}}),ee=d({"../../../node_modules/lodash/_setCacheAdd.js"(e,t){t.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}}}),te=d({"../../../node_modules/lodash/_setCacheHas.js"(e,t){t.exports=function(e){return this.__data__.has(e)}}}),oe=d({"../../../node_modules/lodash/_SetCache.js"(e,t){var o=X(),r=ee(),s=te();function n(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new o;++t<r;)this.add(e[t])}n.prototype.add=n.prototype.push=r,n.prototype.has=s,t.exports=n}}),re=d({"../../../node_modules/lodash/_arraySome.js"(e,t){t.exports=function(e,t){for(var o=-1,r=null==e?0:e.length;++o<r;)if(t(e[o],o,e))return!0;return!1}}}),se=d({"../../../node_modules/lodash/_cacheHas.js"(e,t){t.exports=function(e,t){return e.has(t)}}}),ne=d({"../../../node_modules/lodash/_equalArrays.js"(e,t){var o=oe(),r=re(),s=se();t.exports=function(e,t,n,a,u,l){var d=1&n,i=e.length,c=t.length;if(i!=c&&!(d&&c>i))return!1;var _=l.get(e),p=l.get(t);if(_&&p)return _==t&&p==e;var h=-1,f=!0,j=2&n?new o:void 0;for(l.set(e,t),l.set(t,e);++h<i;){var v=e[h],b=t[h];if(a)var y=d?a(b,v,h,t,e,l):a(v,b,h,e,t,l);if(void 0!==y){if(y)continue;f=!1;break}if(j){if(!r(t,(function(e,t){if(!s(j,t)&&(v===e||u(v,e,n,a,l)))return j.push(t)}))){f=!1;break}}else if(v!==b&&!u(v,b,n,a,l)){f=!1;break}}return l.delete(e),l.delete(t),f}}}),ae=d({"../../../node_modules/lodash/_Uint8Array.js"(e,t){var o=O().Uint8Array;t.exports=o}}),ue=d({"../../../node_modules/lodash/_mapToArray.js"(e,t){t.exports=function(e){var t=-1,o=Array(e.size);return e.forEach((function(e,r){o[++t]=[r,e]})),o}}}),le=d({"../../../node_modules/lodash/_setToArray.js"(e,t){t.exports=function(e){var t=-1,o=Array(e.size);return e.forEach((function(e){o[++t]=e})),o}}}),de=d({"../../../node_modules/lodash/_equalByTag.js"(e,t){var o=w(),r=ae(),s=c(),n=ne(),a=ue(),u=le(),l=o?o.prototype:void 0,d=l?l.valueOf:void 0;t.exports=function(e,t,o,l,i,c,_){switch(o){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!c(new r(e),new r(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=a;case"[object Set]":var h=1&l;if(p||(p=u),e.size!=t.size&&!h)return!1;var f=_.get(e);if(f)return f==t;l|=2,_.set(e,t);var j=n(p(e),p(t),l,i,c,_);return _.delete(e),j;case"[object Symbol]":if(d)return d.call(e)==d.call(t)}return!1}}}),ie=d({"../../../node_modules/lodash/_arrayPush.js"(e,t){t.exports=function(e,t){for(var o=-1,r=t.length,s=e.length;++o<r;)e[s+o]=t[o];return e}}}),ce=d({"../../../node_modules/lodash/isArray.js"(e,t){var o=Array.isArray;t.exports=o}}),_e=d({"../../../node_modules/lodash/_baseGetAllKeys.js"(e,t){var o=ie(),r=ce();t.exports=function(e,t,s){var n=t(e);return r(e)?n:o(n,s(e))}}}),pe=d({"../../../node_modules/lodash/_arrayFilter.js"(e,t){t.exports=function(e,t){for(var o=-1,r=null==e?0:e.length,s=0,n=[];++o<r;){var a=e[o];t(a,o,e)&&(n[s++]=a)}return n}}}),he=d({"../../../node_modules/lodash/stubArray.js"(e,t){t.exports=function(){return[]}}}),fe=d({"../../../node_modules/lodash/_getSymbols.js"(e,t){var o=pe(),r=he(),s=Object.prototype.propertyIsEnumerable,n=Object.getOwnPropertySymbols,a=n?function(e){return null==e?[]:(e=Object(e),o(n(e),(function(t){return s.call(e,t)})))}:r;t.exports=a}}),je=d({"../../../node_modules/lodash/_baseTimes.js"(e,t){t.exports=function(e,t){for(var o=-1,r=Array(e);++o<e;)r[o]=t(o);return r}}}),ve=d({"../../../node_modules/lodash/isObjectLike.js"(e,t){t.exports=function(e){return null!=e&&"object"==typeof e}}}),be=d({"../../../node_modules/lodash/_baseIsArguments.js"(e,t){var o=k(),r=ve();t.exports=function(e){return r(e)&&"[object Arguments]"==o(e)}}}),ye=d({"../../../node_modules/lodash/isArguments.js"(e,t){var o=be(),r=ve(),s=Object.prototype,n=s.hasOwnProperty,a=s.propertyIsEnumerable,u=o(function(){return arguments}())?o:function(e){return r(e)&&n.call(e,"callee")&&!a.call(e,"callee")};t.exports=u}}),me=d({"../../../node_modules/lodash/stubFalse.js"(e,t){t.exports=function(){return!1}}}),xe=d({"../../../node_modules/lodash/isBuffer.js"(e,t){var o=O(),r=me(),s="object"==typeof e&&e&&!e.nodeType&&e,n=s&&"object"==typeof t&&t&&!t.nodeType&&t,a=n&&n.exports===s?o.Buffer:void 0,u=(a?a.isBuffer:void 0)||r;t.exports=u}}),ge=d({"../../../node_modules/lodash/_isIndex.js"(e,t){var o=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&o.test(e))&&e>-1&&e%1==0&&e<t}}}),Oe=d({"../../../node_modules/lodash/isLength.js"(e,t){t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}}),we=d({"../../../node_modules/lodash/_baseIsTypedArray.js"(e,t){var o=k(),r=Oe(),s=ve(),n={};n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,t.exports=function(e){return s(e)&&r(e.length)&&!!n[o(e)]}}}),Ae=d({"../../../node_modules/lodash/_baseUnary.js"(e,t){t.exports=function(e){return function(t){return e(t)}}}}),Se=d({"../../../node_modules/lodash/_nodeUtil.js"(e,t){var o=g(),r="object"==typeof e&&e&&!e.nodeType&&e,s=r&&"object"==typeof t&&t&&!t.nodeType&&t,n=s&&s.exports===r&&o.process,a=function(){try{var e=s&&s.require&&s.require("util").types;return e||n&&n.binding&&n.binding("util")}catch(e){}}();t.exports=a}}),ke=d({"../../../node_modules/lodash/isTypedArray.js"(e,t){var o=we(),r=Ae(),s=Se(),n=s&&s.isTypedArray,a=n?r(n):o;t.exports=a}}),ze=d({"../../../node_modules/lodash/_arrayLikeKeys.js"(e,t){var o=je(),r=ye(),s=ce(),n=xe(),a=ge(),u=ke(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var d=s(e),i=!d&&r(e),c=!d&&!i&&n(e),_=!d&&!i&&!c&&u(e),p=d||i||c||_,h=p?o(e.length,String):[],f=h.length;for(var j in e)!t&&!l.call(e,j)||p&&("length"==j||c&&("offset"==j||"parent"==j)||_&&("buffer"==j||"byteLength"==j||"byteOffset"==j)||a(j,f))||h.push(j);return h}}}),Pe=d({"../../../node_modules/lodash/_isPrototype.js"(e,t){var o=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||o)}}}),Ce=d({"../../../node_modules/lodash/_overArg.js"(e,t){t.exports=function(e,t){return function(o){return e(t(o))}}}}),Te=d({"../../../node_modules/lodash/_nativeKeys.js"(e,t){var o=Ce()(Object.keys,Object);t.exports=o}}),De=d({"../../../node_modules/lodash/_baseKeys.js"(e,t){var o=Pe(),r=Te(),s=Object.prototype.hasOwnProperty;t.exports=function(e){if(!o(e))return r(e);var t=[];for(var n in Object(e))s.call(e,n)&&"constructor"!=n&&t.push(n);return t}}}),Ee=d({"../../../node_modules/lodash/isArrayLike.js"(e,t){var o=P(),r=Oe();t.exports=function(e){return null!=e&&r(e.length)&&!o(e)}}}),Ie=d({"../../../node_modules/lodash/keys.js"(e,t){var o=ze(),r=De(),s=Ee();t.exports=function(e){return s(e)?o(e):r(e)}}}),Me=d({"../../../node_modules/lodash/_getAllKeys.js"(e,t){var o=_e(),r=fe(),s=Ie();t.exports=function(e){return o(e,s,r)}}}),qe=d({"../../../node_modules/lodash/_equalObjects.js"(e,t){var o=Me(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,s,n,a,u){var l=1&s,d=o(e),i=d.length;if(i!=o(t).length&&!l)return!1;for(var c=i;c--;){var _=d[c];if(!(l?_ in t:r.call(t,_)))return!1}var p=u.get(e),h=u.get(t);if(p&&h)return p==t&&h==e;var f=!0;u.set(e,t),u.set(t,e);for(var j=l;++c<i;){var v=e[_=d[c]],b=t[_];if(n)var y=l?n(b,v,_,t,e,u):n(v,b,_,e,t,u);if(!(void 0===y?v===b||a(v,b,s,n,u):y)){f=!1;break}j||(j="constructor"==_)}if(f&&!j){var m=e.constructor,x=t.constructor;m==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof x&&x instanceof x||(f=!1)}return u.delete(e),u.delete(t),f}}}),Fe=d({"../../../node_modules/lodash/_DataView.js"(e,t){var o=M()(O(),"DataView");t.exports=o}}),Ne=d({"../../../node_modules/lodash/_Promise.js"(e,t){var o=M()(O(),"Promise");t.exports=o}}),Le=d({"../../../node_modules/lodash/_Set.js"(e,t){var o=M()(O(),"Set");t.exports=o}}),Be=d({"../../../node_modules/lodash/_WeakMap.js"(e,t){var o=M()(O(),"WeakMap");t.exports=o}}),Ue=d({"../../../node_modules/lodash/_getTag.js"(e,t){var o=Fe(),r=q(),s=Ne(),n=Le(),a=Be(),u=k(),l=D(),d="[object Map]",i="[object Promise]",c="[object Set]",_="[object WeakMap]",p="[object DataView]",h=l(o),f=l(r),j=l(s),v=l(n),b=l(a),y=u;(o&&y(new o(new ArrayBuffer(1)))!=p||r&&y(new r)!=d||s&&y(s.resolve())!=i||n&&y(new n)!=c||a&&y(new a)!=_)&&(y=function(e){var t=u(e),o="[object Object]"==t?e.constructor:void 0,r=o?l(o):"";if(r)switch(r){case h:return p;case f:return d;case j:return i;case v:return c;case b:return _}return t}),t.exports=y}}),Ge=d({"../../../node_modules/lodash/_baseIsEqualDeep.js"(e,t){var o=Z(),r=ne(),s=de(),n=qe(),a=Ue(),u=ce(),l=xe(),d=ke(),i="[object Arguments]",c="[object Array]",_="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(e,t,h,f,j,v){var b=u(e),y=u(t),m=b?c:a(e),x=y?c:a(t),g=(m=m==i?_:m)==_,O=(x=x==i?_:x)==_,w=m==x;if(w&&l(e)){if(!l(t))return!1;b=!0,g=!1}if(w&&!g)return v||(v=new o),b||d(e)?r(e,t,h,f,j,v):s(e,t,m,h,f,j,v);if(!(1&h)){var A=g&&p.call(e,"__wrapped__"),S=O&&p.call(t,"__wrapped__");if(A||S){var k=A?e.value():e,z=S?t.value():t;return v||(v=new o),j(k,z,h,f,v)}}return!!w&&(v||(v=new o),n(e,t,h,f,j,v))}}}),$e=d({"../../../node_modules/lodash/_baseIsEqual.js"(e,t){var o=Ge(),r=ve();t.exports=function e(t,s,n,a,u){return t===s||(null==t||null==s||!r(t)&&!r(s)?t!=t&&s!=s:o(t,s,n,a,e,u))}}}),He=d({"../../../node_modules/lodash/isEqual.js"(e,t){var o=$e();t.exports=function(e,t){return o(e,t)}}}),Ke=(e=He(),o=null!=e?r(u(e)):{},((e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let u of a(t))l.call(e,u)||u===o||s(e,u,{get:()=>t[u],enumerable:!(r=n(t,u))||r.enumerable});return e})(!t&&e&&e.__esModule?o:s(o,"default",{value:e,enumerable:!0}),e));import{useLayoutEffect as Re,useMemo as Ve,useRef as We,useState as Je}from"react";function Qe(e,t,o={equals:Ke.default}){const{debugName:r,equals:s}=o,n=We(t);n.current=t;const a=We({reaction:Ze,engine:void 0}),[,u]=Je(0);if(a.current.engine!==e)if(e){const t=e.reactor.createReaction(r);a.current={reaction:t,engine:e}}else a.current={reaction:Ze,engine:e};const l=a.current.reaction,d=Ve((()=>{const t=()=>(0,n.current)(e);return function(e,t){if(!t)return e;let o;return(...r)=>{const s=e(...r);return t(s,o)||(o=s),o}}((()=>l.track(t)),s)}),[l,s,e]),i=d();return Re((()=>l.subscribe((function(){u((e=>e+1))}))),[l]),i}function Xe(e,t){const o=t?.debugName,r=t?.useEngine;let s=0;function n(t,n,...a){const u=r?.()??t.engine,l=We();return void 0===l.current&&null!=o&&(l.current=o+s++),Qe(u,e.bind(void 0,{...t,engine:u},n,...a),{debugName:l.current,equals:Ye})??null}return n.displayName=`withEngine(${e.displayName||e.name})`,n}var Ye=(e,t)=>e===t,Ze={track:e=>e(),subscribe:()=>function(){}};export{Qe as useEngineSelector,Xe as withEngine};
|
|
File without changes
|