@potok-web-framework/core 0.10.0 → 0.12.0
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/client.mjs +1 -1
- package/dist/{fragment-CXNEPBWB.mjs → fragment-miU_1DSF.mjs} +2 -2
- package/dist/{get-component-instance-id-CP6LDtpX.mjs → get-component-instance-id-BC0t58Yc.mjs} +4 -4
- package/dist/hmr.mjs +3 -3
- package/dist/{html-element-DBut4UCf.mjs → html-element-C4QFddWA.mjs} +2 -2
- package/dist/index.mjs +6 -6
- package/dist/jsx-runtime.mjs +3 -3
- package/dist/{lib-node-DyXPvvVQ.mjs → lib-node-JxhtuJyh.mjs} +9 -11
- package/dist/{normalize-children-BWrn16R7.mjs → normalize-children-Dh51Diw_.mjs} +1 -1
- package/dist/{register-component-B92kGFqC.mjs → register-component-BpqHm9l-.mjs} +4 -4
- package/dist/server.mjs +6 -4
- package/dist/store.mjs +3 -3
- package/package.json +2 -3
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as createSignal, n as batch, r as createEffect } from "./lib-node-
|
|
1
|
+
import { i as createSignal, n as batch, r as createEffect } from "./lib-node-JxhtuJyh.mjs";
|
|
2
2
|
import { i as PRELOAD_SCRIPTS_SCRIPT_ID, n as HYDRATION_STATE_SCRIPT_ID, r as NON_BUBBLING_EVENTS } from "./constants-Bxn0R4hW.mjs";
|
|
3
3
|
import { t as deserializeWithTypes } from "./serialization-qOayQbjE.mjs";
|
|
4
4
|
import { n as normalizeCssPropertyValue, t as normalizeCssPropertyName } from "./css-BercB0Kp.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as LibBlock } from "./lib-node-
|
|
2
|
-
import { i as mergeContext, t as normalizeChildren } from "./normalize-children-
|
|
1
|
+
import { l as LibBlock } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as mergeContext, t as normalizeChildren } from "./normalize-children-Dh51Diw_.mjs";
|
|
3
3
|
var FragmentClass = class extends LibBlock {
|
|
4
4
|
constructor(e, r) {
|
|
5
5
|
super(), this.props = e, this.context = r, normalizeChildren(e.children).forEach((e, n) => {
|
package/dist/{get-component-instance-id-CP6LDtpX.mjs → get-component-instance-id-BC0t58Yc.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as createSignal, l as LibBlock } from "./lib-node-
|
|
2
|
-
import { i as mergeContext, r as normalizeArray, t as normalizeChildren } from "./normalize-children-
|
|
1
|
+
import { i as createSignal, l as LibBlock } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as mergeContext, r as normalizeArray, t as normalizeChildren } from "./normalize-children-Dh51Diw_.mjs";
|
|
3
3
|
var LibContextReaderClass = class extends LibBlock {
|
|
4
4
|
constructor(e, t) {
|
|
5
5
|
super(), this.props = e, this.context = t, normalizeArray(e.children).forEach((e, r) => {
|
|
@@ -62,7 +62,7 @@ var RegisteredComponent = class {
|
|
|
62
62
|
this.cachedInstances.delete(e);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
const HMR_COMPONENTS_REGISTRY = new class {
|
|
65
|
+
const HMR_COMPONENTS_REGISTRY = /* @__PURE__ */ new class {
|
|
66
66
|
components = /* @__PURE__ */ new Map();
|
|
67
67
|
getModuleComponentsMap(e) {
|
|
68
68
|
return this.components.has(e) || this.components.set(e, /* @__PURE__ */ new Map()), this.components.get(e);
|
|
@@ -88,7 +88,7 @@ const HMR_COMPONENTS_REGISTRY = new class {
|
|
|
88
88
|
let n = this.getRegisteredComponent(e, t);
|
|
89
89
|
if (n) for (let e of n.subscribers) e(n);
|
|
90
90
|
}
|
|
91
|
-
}(), HMR_STATE_CACHE = /* @__PURE__ */ new Map(), HMR_STYLES = createSignal({ styles: [] });
|
|
91
|
+
}(), HMR_STATE_CACHE = /* @__PURE__ */ new Map(), HMR_STYLES = /* @__PURE__ */ createSignal({ styles: [] });
|
|
92
92
|
function getComponentInstanceId(e) {
|
|
93
93
|
let t = [], n = e;
|
|
94
94
|
for (; n;) t.push(n.index), n = n.parentBlock ? n.parentBlock.context : null;
|
package/dist/hmr.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as createSignal } from "./lib-node-
|
|
2
|
-
import { i as HMR_STYLES } from "./get-component-instance-id-
|
|
3
|
-
import { n as registerComponent } from "./register-component-
|
|
1
|
+
import { i as createSignal } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as HMR_STYLES } from "./get-component-instance-id-BC0t58Yc.mjs";
|
|
3
|
+
import { n as registerComponent } from "./register-component-BpqHm9l-.mjs";
|
|
4
4
|
function registerStyle(n, r) {
|
|
5
5
|
let i = HMR_STYLES.styles.find((e) => e.id === n);
|
|
6
6
|
i ? i.css = r : HMR_STYLES.styles = [...HMR_STYLES.styles, createSignal({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as LibNode } from "./lib-node-
|
|
2
|
-
import { i as mergeContext, t as normalizeChildren } from "./normalize-children-
|
|
1
|
+
import { t as LibNode } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as mergeContext, t as normalizeChildren } from "./normalize-children-Dh51Diw_.mjs";
|
|
3
3
|
function potokPreload(e, t) {
|
|
4
4
|
let n = () => e();
|
|
5
5
|
return n.dependencies = t, n;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as deepTrack, c as untrack, i as createSignal, l as LibBlock, n as batch, o as getSignal, r as createEffect, s as isSignal } from "./lib-node-
|
|
2
|
-
import { i as mergeContext, n as text, t as normalizeChildren } from "./normalize-children-
|
|
3
|
-
import { a as Lifecycle, i as HMR_STYLES, o as LibContextReader } from "./get-component-instance-id-
|
|
4
|
-
import { r as Show, t as isRegisteredComponentElement } from "./register-component-
|
|
5
|
-
import { n as isPotokPreloader, t as htmlElement } from "./html-element-
|
|
6
|
-
import { t as fragment } from "./fragment-
|
|
1
|
+
import { a as deepTrack, c as untrack, i as createSignal, l as LibBlock, n as batch, o as getSignal, r as createEffect, s as isSignal } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as mergeContext, n as text, t as normalizeChildren } from "./normalize-children-Dh51Diw_.mjs";
|
|
3
|
+
import { a as Lifecycle, i as HMR_STYLES, o as LibContextReader } from "./get-component-instance-id-BC0t58Yc.mjs";
|
|
4
|
+
import { r as Show, t as isRegisteredComponentElement } from "./register-component-BpqHm9l-.mjs";
|
|
5
|
+
import { n as isPotokPreloader, t as htmlElement } from "./html-element-C4QFddWA.mjs";
|
|
6
|
+
import { t as fragment } from "./fragment-miU_1DSF.mjs";
|
|
7
7
|
import { i as PRELOAD_SCRIPTS_SCRIPT_ID, n as HYDRATION_STATE_SCRIPT_ID } from "./constants-Bxn0R4hW.mjs";
|
|
8
8
|
import { t as escapeFromScriptTag } from "./escape-from-script-tag-CRT2evI1.mjs";
|
|
9
9
|
import { n as serializeWithTypes } from "./serialization-qOayQbjE.mjs";
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as text } from "./normalize-children-
|
|
2
|
-
import { r as potokPreload, t as htmlElement } from "./html-element-
|
|
3
|
-
import { t as fragment } from "./fragment-
|
|
1
|
+
import { n as text } from "./normalize-children-Dh51Diw_.mjs";
|
|
2
|
+
import { r as potokPreload, t as htmlElement } from "./html-element-C4QFddWA.mjs";
|
|
3
|
+
import { t as fragment } from "./fragment-miU_1DSF.mjs";
|
|
4
4
|
function detectChild(e) {
|
|
5
5
|
let t = e.value, n = typeof t;
|
|
6
6
|
return n === "string" || n === "number" || n === "boolean" ? text({ get text() {
|
|
@@ -94,20 +94,18 @@ function createEffect(e, i = !1) {
|
|
|
94
94
|
version: 0,
|
|
95
95
|
ignoreVersion: i,
|
|
96
96
|
dispose() {
|
|
97
|
-
|
|
97
|
+
o.subscriptions.forEach((e, t) => {
|
|
98
|
+
t.subscribers.delete(o);
|
|
99
|
+
}), o.subscriptions.clear(), a = !0;
|
|
98
100
|
},
|
|
99
101
|
runCallback() {
|
|
100
|
-
if (a) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
if (!a) {
|
|
103
|
+
if (currentBatch) {
|
|
104
|
+
currentBatch.add(o);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
currentEffect = o, o.version++, e(), currentEffect = null;
|
|
105
108
|
}
|
|
106
|
-
if (currentBatch) {
|
|
107
|
-
currentBatch.add(o);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
currentEffect = o, o.version++, e(), currentEffect = null;
|
|
111
109
|
}
|
|
112
110
|
};
|
|
113
111
|
return currentDisposer && currentDisposer.effects.add(o), o.runCallback(), o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as untrack, i as createSignal, l as LibBlock, r as createEffect } from "./lib-node-
|
|
2
|
-
import { i as mergeContext, t as normalizeChildren } from "./normalize-children-
|
|
3
|
-
import { a as Lifecycle, n as HMR_COMPONENTS_REGISTRY, o as LibContextReader, t as getComponentInstanceId } from "./get-component-instance-id-
|
|
4
|
-
import { t as fragment } from "./fragment-
|
|
1
|
+
import { c as untrack, i as createSignal, l as LibBlock, r as createEffect } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as mergeContext, t as normalizeChildren } from "./normalize-children-Dh51Diw_.mjs";
|
|
3
|
+
import { a as Lifecycle, n as HMR_COMPONENTS_REGISTRY, o as LibContextReader, t as getComponentInstanceId } from "./get-component-instance-id-BC0t58Yc.mjs";
|
|
4
|
+
import { t as fragment } from "./fragment-miU_1DSF.mjs";
|
|
5
5
|
var ShowClass = class extends LibBlock {
|
|
6
6
|
constructor(t, n) {
|
|
7
7
|
super(), this.props = t, this.context = n;
|
package/dist/server.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as createSignal, n as batch } from "./lib-node-
|
|
1
|
+
import { i as createSignal, n as batch } from "./lib-node-JxhtuJyh.mjs";
|
|
2
2
|
import { t as escapeFromScriptTag } from "./escape-from-script-tag-CRT2evI1.mjs";
|
|
3
3
|
import { n as normalizeCssPropertyValue, t as normalizeCssPropertyName } from "./css-BercB0Kp.mjs";
|
|
4
4
|
import { clientDependencies } from "virtual:client-variables";
|
|
@@ -102,7 +102,7 @@ async function renderToString(n) {
|
|
|
102
102
|
function s(e) {
|
|
103
103
|
return i.has(e) || i.set(e, new ServerNode(e)), i.get(e);
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
let c = n({
|
|
106
106
|
parentBlock: null,
|
|
107
107
|
index: 0,
|
|
108
108
|
portals: r.portals,
|
|
@@ -119,7 +119,9 @@ async function renderToString(n) {
|
|
|
119
119
|
removeNode(e) {
|
|
120
120
|
i.get(e)?.remove();
|
|
121
121
|
}
|
|
122
|
-
})
|
|
123
|
-
|
|
122
|
+
});
|
|
123
|
+
if (await Promise.all(o), !a) throw Error("Корневая нода не найдена");
|
|
124
|
+
let l = a.stringify();
|
|
125
|
+
return c.unmount(), l;
|
|
124
126
|
}
|
|
125
127
|
export { bootstrapApp, renderToString };
|
package/dist/store.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as deepTrack, i as createSignal, l as LibBlock, n as batch, r as createEffect } from "./lib-node-
|
|
2
|
-
import { i as mergeContext, r as normalizeArray, t as normalizeChildren } from "./normalize-children-
|
|
3
|
-
import { a as Lifecycle, o as LibContextReader, r as HMR_STATE_CACHE, t as getComponentInstanceId } from "./get-component-instance-id-
|
|
1
|
+
import { a as deepTrack, i as createSignal, l as LibBlock, n as batch, r as createEffect } from "./lib-node-JxhtuJyh.mjs";
|
|
2
|
+
import { i as mergeContext, r as normalizeArray, t as normalizeChildren } from "./normalize-children-Dh51Diw_.mjs";
|
|
3
|
+
import { a as Lifecycle, o as LibContextReader, r as HMR_STATE_CACHE, t as getComponentInstanceId } from "./get-component-instance-id-BC0t58Yc.mjs";
|
|
4
4
|
import { t as isPureObject } from "./is-pure-object-s_MkQp1w.mjs";
|
|
5
5
|
var ContextProvider = class extends LibBlock {
|
|
6
6
|
constructor(e, t, n) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@potok-web-framework/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./dist/index.mjs",
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "vite build",
|
|
34
|
-
"build:watch": "vite build --watch"
|
|
35
|
-
"prepublishOnly": "bun run build"
|
|
34
|
+
"build:watch": "vite build --watch"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@types/bun": "^1.3.6",
|