@potok-web-framework/core 0.11.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 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";
@@ -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";
@@ -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
- if (n({
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
- }), await Promise.all(o), !a) throw Error("Корневая нода не найдена");
123
- return a.stringify();
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-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.12.0",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/index.mjs",