rosetty-solid
Advanced tools
Comparing version 1.0.23 to 1.0.24
import { Language, RosettyReturn } from 'rosetty'; | ||
import { Accessor, JSX } from 'solid-js'; | ||
import { Accessor, children, JSX } from 'solid-js'; | ||
export declare const RosettyContext: import("solid-js").Context<unknown>; | ||
@@ -4,0 +4,0 @@ export declare const RosettyProvider: (props: { |
@@ -29,2 +29,5 @@ 'use strict'; | ||
}, [props.languages]); | ||
var c = solidJs.children(function () { | ||
return props.children; | ||
}); | ||
var _createSignal = solidJs.createSignal(props.defaultLanguage), | ||
@@ -44,3 +47,3 @@ actualLang = _createSignal[0], | ||
get children() { | ||
return props.children; | ||
return c(); | ||
} | ||
@@ -47,0 +50,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("solid-js/web"),t=require("rosetty"),r=require("solid-js");function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a=r.createContext();exports.RosettyContext=a,exports.RosettyProvider=function(o){var u=r.createMemo((function(){return t.rosetty(o.languages,o.defaultLanguage,o.translateFallback)}),[o.languages]),s=r.createSignal(o.defaultLanguage),i=s[0],c=s[1],g=n({},u(),{actualLang:i,changeLang:function(e){u().changeLang(e),c(u().getCurrentLang())}});return e.createComponent(a.Provider,{value:g,get children(){return o.children}})},exports.useRosetty=function(){return r.useContext(a)}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("solid-js/web"),t=require("rosetty"),r=require("solid-js");function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a=r.createContext();exports.RosettyContext=a,exports.RosettyProvider=function(o){var u=r.createMemo((function(){return t.rosetty(o.languages,o.defaultLanguage,o.translateFallback)}),[o.languages]),s=r.children((function(){return o.children})),i=r.createSignal(o.defaultLanguage),c=i[0],l=i[1],g=n({},u(),{actualLang:c,changeLang:function(e){u().changeLang(e),l(u().getCurrentLang())}});return e.createComponent(a.Provider,{value:g,get children(){return s()}})},exports.useRosetty=function(){return r.useContext(a)}; | ||
//# sourceMappingURL=rosetty-solid.cjs.production.min.js.map |
import { createComponent } from 'solid-js/web'; | ||
import { rosetty } from 'rosetty'; | ||
import { createContext, createMemo, createSignal, useContext } from 'solid-js'; | ||
import { createContext, createMemo, children, createSignal, useContext } from 'solid-js'; | ||
@@ -25,2 +25,5 @@ function _extends() { | ||
}, [props.languages]); | ||
var c = children(function () { | ||
return props.children; | ||
}); | ||
var _createSignal = createSignal(props.defaultLanguage), | ||
@@ -40,3 +43,3 @@ actualLang = _createSignal[0], | ||
get children() { | ||
return props.children; | ||
return c(); | ||
} | ||
@@ -43,0 +46,0 @@ }); |
{ | ||
"version": "1.0.23", | ||
"version": "1.0.24", | ||
"license": "MIT", | ||
@@ -21,11 +21,2 @@ "main": "dist/index.js", | ||
}, | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"test": "jest", | ||
"lint": "eslint src test", | ||
"prepare": "tsdx build", | ||
"size": "size-limit", | ||
"analyze": "size-limit --why" | ||
}, | ||
"husky": { | ||
@@ -111,3 +102,11 @@ "hooks": { | ||
"solid-js": "^1.7.11" | ||
}, | ||
"scripts": { | ||
"start": "tsdx watch", | ||
"build": "tsdx build", | ||
"test": "jest", | ||
"lint": "eslint src test", | ||
"size": "size-limit", | ||
"analyze": "size-limit --why" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20260
179