@potok-web-framework/core 0.11.0 → 0.13.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 CHANGED
@@ -1,4 +1,4 @@
1
- import { i as createSignal, n as batch, r as createEffect } from "./lib-node-DyXPvvVQ.mjs";
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-DyXPvvVQ.mjs";
2
- import { i as mergeContext, t as normalizeChildren } from "./normalize-children-BWrn16R7.mjs";
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) => {
@@ -1,5 +1,5 @@
1
- import { i as createSignal, l as LibBlock } from "./lib-node-DyXPvvVQ.mjs";
2
- import { i as mergeContext, r as normalizeArray, t as normalizeChildren } from "./normalize-children-BWrn16R7.mjs";
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) => {
package/dist/hmr.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { i as createSignal } from "./lib-node-DyXPvvVQ.mjs";
2
- import { i as HMR_STYLES } from "./get-component-instance-id-DZpM6tZE.mjs";
3
- import { n as registerComponent } from "./register-component-DNEe4xbV.mjs";
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-DyXPvvVQ.mjs";
2
- import { i as mergeContext, t as normalizeChildren } from "./normalize-children-BWrn16R7.mjs";
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-DyXPvvVQ.mjs";
2
- import { i as mergeContext, n as text, t as normalizeChildren } from "./normalize-children-BWrn16R7.mjs";
3
- import { a as Lifecycle, i as HMR_STYLES, o as LibContextReader } from "./get-component-instance-id-DZpM6tZE.mjs";
4
- import { r as Show, t as isRegisteredComponentElement } from "./register-component-DNEe4xbV.mjs";
5
- import { n as isPotokPreloader, t as htmlElement } from "./html-element-DBut4UCf.mjs";
6
- import { t as fragment } from "./fragment-CXNEPBWB.mjs";
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";
@@ -152,8 +152,6 @@ var ListClass = class extends LibBlock {
152
152
  });
153
153
  }), this.entries.forEach((e, n) => {
154
154
  t.has(n) || e.block.unmount();
155
- }), this.children.forEach((e) => {
156
- e?.isNode() && e.insert();
157
155
  }), this.entries = t;
158
156
  }
159
157
  unmount() {
@@ -1,6 +1,6 @@
1
- import { n as text } from "./normalize-children-BWrn16R7.mjs";
2
- import { r as potokPreload, t as htmlElement } from "./html-element-DBut4UCf.mjs";
3
- import { t as fragment } from "./fragment-CXNEPBWB.mjs";
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
- a = !0;
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
- o.subscriptions.forEach((e, t) => {
102
- t.subscribers.delete(o);
103
- }), o.subscriptions.clear();
104
- return;
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,4 +1,4 @@
1
- import { t as LibNode } from "./lib-node-DyXPvvVQ.mjs";
1
+ import { t as LibNode } from "./lib-node-JxhtuJyh.mjs";
2
2
  function mergeContext(e, t) {
3
3
  return {
4
4
  parentBlock: t.parentBlock,
@@ -1,7 +1,7 @@
1
- import { c as untrack, i as createSignal, l as LibBlock, r as createEffect } from "./lib-node-DyXPvvVQ.mjs";
2
- import { i as mergeContext, t as normalizeChildren } from "./normalize-children-BWrn16R7.mjs";
3
- import { a as Lifecycle, n as HMR_COMPONENTS_REGISTRY, o as LibContextReader, t as getComponentInstanceId } from "./get-component-instance-id-DZpM6tZE.mjs";
4
- import { t as fragment } from "./fragment-CXNEPBWB.mjs";
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-DyXPvvVQ.mjs";
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";
@@ -36,7 +36,8 @@ var ServerNode = class {
36
36
  this.libNode = e;
37
37
  }
38
38
  addChild(e, t) {
39
- if (t) {
39
+ let n = this.children.indexOf(e);
40
+ if (n !== -1 && this.children.splice(n, 1), t) {
40
41
  let n = this.children.indexOf(t);
41
42
  this.children.splice(n + 1, 0, e);
42
43
  } else this.children.push(e);
@@ -102,7 +103,7 @@ async function renderToString(n) {
102
103
  function s(e) {
103
104
  return i.has(e) || i.set(e, new ServerNode(e)), i.get(e);
104
105
  }
105
- if (n({
106
+ let c = n({
106
107
  parentBlock: null,
107
108
  index: 0,
108
109
  portals: r.portals,
@@ -119,7 +120,9 @@ async function renderToString(n) {
119
120
  removeNode(e) {
120
121
  i.get(e)?.remove();
121
122
  }
122
- }), await Promise.all(o), !a) throw Error("Корневая нода не найдена");
123
- return a.stringify();
123
+ });
124
+ if (await Promise.all(o), !a) throw Error("Корневая нода не найдена");
125
+ let l = a.stringify();
126
+ return c.unmount(), l;
124
127
  }
125
128
  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-DyXPvvVQ.mjs";
2
- import { i as mergeContext, r as normalizeArray, t as normalizeChildren } from "./normalize-children-BWrn16R7.mjs";
3
- import { a as Lifecycle, o as LibContextReader, r as HMR_STATE_CACHE, t as getComponentInstanceId } from "./get-component-instance-id-DZpM6tZE.mjs";
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.11.0",
3
+ "version": "0.13.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.mjs",