olova 2.0.17 → 2.0.19
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/Link.d.ts +8 -0
- package/dist/Link.js +8 -0
- package/dist/Router.d.ts +53 -0
- package/dist/Router.js +11 -0
- package/dist/chunk-CYX762OE.js +21 -0
- package/dist/chunk-K6EDUQDD.js +19 -0
- package/dist/chunk-LOK5UEME.js +7 -0
- package/dist/chunk-NEMX72XA.js +39 -0
- package/dist/chunk-XGX5YRJV.js +27 -0
- package/dist/chunk-Y3CEUWVD.js +153 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.js +72 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +32 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.js +87 -0
- package/dist/useParams.d.ts +4 -0
- package/dist/useParams.js +11 -0
- package/dist/usePathname.d.ts +7 -0
- package/dist/usePathname.js +8 -0
- package/dist/useSearchParams.d.ts +27 -0
- package/dist/useSearchParams.js +8 -0
- package/package.json +58 -15
- package/.github/workflows/publish.yml +0 -18
- package/README.md +0 -1
- package/dist/olova.d.ts +0 -1
- package/dist/olova.js +0 -1
- package/package-lock.json +0 -1433
package/package.json
CHANGED
|
@@ -1,15 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
|
|
2
|
+
{
|
|
3
|
+
"name": "olova",
|
|
4
|
+
"version": "2.0.19",
|
|
5
|
+
"description": "Olova framework core",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./Link": {
|
|
16
|
+
"import": "./dist/Link.js",
|
|
17
|
+
"types": "./dist/Link.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./useSearchParams": {
|
|
20
|
+
"import": "./dist/useSearchParams.js",
|
|
21
|
+
"types": "./dist/useSearchParams.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./usePathname": {
|
|
24
|
+
"import": "./dist/usePathname.js",
|
|
25
|
+
"types": "./dist/usePathname.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./useParams": {
|
|
28
|
+
"import": "./dist/useParams.js",
|
|
29
|
+
"types": "./dist/useParams.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./Router": {
|
|
32
|
+
"import": "./dist/Router.js",
|
|
33
|
+
"types": "./dist/Router.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./client": {
|
|
36
|
+
"import": "./dist/client.js",
|
|
37
|
+
"types": "./dist/client.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./server": {
|
|
40
|
+
"import": "./dist/server.js",
|
|
41
|
+
"types": "./dist/server.d.ts"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup index.ts Link.tsx useSearchParams.ts usePathname.ts useParams.ts Router.tsx server.tsx client.tsx --format esm --dts --clean --external virtual:olova-routes react react-dom react-dom/client react-dom/server",
|
|
46
|
+
"prepublishOnly": "npm run build"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": ">=18.0.0",
|
|
50
|
+
"react-dom": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"tsup": "^8.0.0",
|
|
54
|
+
"typescript": "^5.0.0",
|
|
55
|
+
"@types/react": "^19.0.0",
|
|
56
|
+
"@types/react-dom": "^19.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
name: Publish to NPM
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ main ]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v2
|
|
12
|
-
- uses: actions/setup-node@v2
|
|
13
|
-
with:
|
|
14
|
-
node-version: '14'
|
|
15
|
-
registry-url: 'https://registry.npmjs.org'
|
|
16
|
-
- run: yarn publish
|
|
17
|
-
env:
|
|
18
|
-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/dist/olova.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module "olova";
|
package/dist/olova.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const Fragment=Symbol("Fragment");let currentEffect;const setSignal=e=>{const t=new Set;return[()=>{try{return currentEffect&&t.add(currentEffect),e}catch(e){throw console.error("Error in signal getter:",e),e}},r=>{try{return e="function"==typeof r?r(e):r,[...t].forEach((e=>{try{e()}catch(e){console.error("Error in signal subscriber:",e)}})),e}catch(e){throw console.error("Error in signal setter:",e),e}}]},setEffect=e=>{const t=()=>{try{currentEffect=t;const r=e();return currentEffect=null,r}catch(e){throw currentEffect=null,console.error("Error in effect:",e),e}};try{t()}catch(e){console.error("Error initializing effect:",e)}},setMemo=e=>{try{const[t,r]=setSignal();return setEffect((()=>{try{r(e())}catch(e){throw console.error("Error in memo function:",e),e}})),t}catch(e){return console.error("Error creating memo:",e),()=>{}}},html=(e,t,...r)=>{try{if("function"==typeof e)try{return e(t,...r)}catch(e){return console.error("Error in function component:",e),document.createComment(`Error in component: ${e.message}`)}if(e===Fragment||!e){const e=document.createDocumentFragment();return r.flat(1/0).forEach((t=>{null!=t&&e.appendChild(t instanceof Node?t:document.createTextNode(String(t)))})),e}const n=new Set(["svg","path","circle","rect","line","polygon","polyline","ellipse","g","text","defs","filter","mask","marker","pattern","linearGradient","radialGradient","stop","use","clipPath","textPath","tspan","foreignObject"]).has(e),o=n?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);if(t)for(const[e,r]of Object.entries(t))if(null!=r)if("value"===e)o.value=r;else if("className"===e||"class"===e)o.setAttribute("class",r);else if("style"===e&&"object"==typeof r)Object.entries(r).forEach((([e,t])=>{o.style[e]=t}));else if("dangerouslySetInnerHTML"===e&&r.__html)o.innerHTML=r.__html;else if("ref"===e)"function"==typeof r?r(o):r&&"current"in r&&(r.current=o);else if(e.startsWith("on")){const t=e.slice(2).toLowerCase();o.addEventListener(t,r)}else if(n)if(e.includes(":")){const[t,n]=e.split(":"),c={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};c[t]?o.setAttributeNS(c[t],n,r):o.setAttribute(e,r)}else o.setAttribute(e,r);else"boolean"==typeof r?r?o.setAttribute(e,""):o.removeAttribute(e):o.setAttribute(e,r);const c=(e,t)=>{try{if(null==t)return;if(Array.isArray(t))return void t.flat(1/0).forEach((t=>c(e,t)));if(t instanceof Node)e.appendChild(t);else if("function"==typeof t){const r=document.createTextNode("");e.appendChild(r),setEffect((()=>{try{const n=t();if(null==n)return void(r.textContent="");if(Array.isArray(n)){const t=document.createDocumentFragment();for(n.flat(1/0).forEach((e=>{null!=e&&t.appendChild(e instanceof Node?e:document.createTextNode(String(e)))}));r.nextSibling;)e.removeChild(r.nextSibling);e.insertBefore(t,r.nextSibling)}else if(n instanceof Node){for(;r.nextSibling;)e.removeChild(r.nextSibling);e.insertBefore(n,r.nextSibling)}else r.textContent=String(n)}catch(e){console.error("Error in reactive child function:",e),r.textContent=`Error: ${e.message}`}}))}else if("object"==typeof t&&"then"in t&&"function"==typeof t.then){const r=document.createTextNode("");e.appendChild(r),t.then((t=>{try{t instanceof Node?e.replaceChild(t,r):r.textContent=String(t)}catch(e){console.error("Error resolving promise in DOM:",e),r.textContent=`Error: ${e.message}`}})).catch((e=>{console.error("Promise rejected in DOM:",e),r.textContent=`Error: ${e.message}`}))}else e.appendChild(document.createTextNode(String(t)))}catch(e){console.error("Error appending child:",e)}};return r.forEach((e=>c(o,e))),o}catch(e){return console.error("Error creating element:",e),document.createComment(`Error creating element: ${e.message}`)}},render=(e,t,r={})=>{try{if("string"==typeof t&&!(t=document.querySelector(t)))return void console.error(`Cannot find element matching selector: ${t}`);const{clear:n=!0,hydrate:o=!1,beforeRender:c=null}=r;if(n&&!o&&(t.textContent=""),c&&"function"==typeof c)try{c(t)}catch(e){console.error("Error in beforeRender hook:",e)}let i;try{i="function"==typeof e?e():e}catch(e){console.error("Error rendering component:",e);const r=document.createElement("div");return r.className="olova-error",r.textContent=`Render Error: ${e.message}`,t.appendChild(r),r}if(!i)return null;if(Array.isArray(i)){const e=document.createDocumentFragment();return i.flat(1/0).forEach((t=>{t&&e.appendChild(t instanceof Node?t:document.createTextNode(String(t)))})),t.appendChild(e),e}return t.appendChild(i instanceof Node?i:document.createTextNode(String(i))),i}catch(e){return console.error("Error in render function:",e),null}},setRef=()=>{let e=null;return t=>(void 0!==t&&(e=t),e)},onMount=e=>{setEffect((()=>{queueMicrotask((()=>{try{e()}catch(e){console.error("Error in onMount callback:",e)}}))}))},onUnmount=e=>{setEffect((()=>()=>{try{e()}catch(e){console.error("Error in onUnmount cleanup:",e)}}))};export{setSignal,setEffect,setMemo,setRef,html,render,onMount,onUnmount,Fragment};
|