rosetty-solid
Advanced tools
Comparing version 1.0.34 to 1.0.35
@@ -0,8 +1,65 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
'use strict' | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./rosetty-solid.cjs.production.min.js') | ||
} else { | ||
module.exports = require('./rosetty-solid.cjs.development.js') | ||
// src/index.tsx | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
RosettyContext: () => RosettyContext, | ||
RosettyProvider: () => RosettyProvider, | ||
useRosetty: () => useRosetty | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_rosetty = require("rosetty"); | ||
var import_solid_js = require("solid-js"); | ||
var RosettyContext = (0, import_solid_js.createContext)(); | ||
var RosettyProvider = (props) => { | ||
const r = (0, import_solid_js.createMemo)( | ||
() => (0, import_rosetty.rosetty)(props.languages, props.defaultLanguage, props.translateFallback), | ||
[] | ||
); | ||
const [actualLang, setActualLang] = (0, import_solid_js.createSignal)(props.defaultLanguage); | ||
const changeLang = (lang) => { | ||
r().changeLang(lang); | ||
setActualLang(r().getCurrentLang()); | ||
}; | ||
return /* @__PURE__ */ React.createElement( | ||
RosettyContext.Provider, | ||
{ | ||
value: () => ({ | ||
...r(), | ||
actualLang, | ||
changeLang | ||
}) | ||
}, | ||
props.children | ||
); | ||
}; | ||
function useRosetty() { | ||
const client = (0, import_solid_js.useContext)(RosettyContext); | ||
if (!client) { | ||
throw new Error("No RosettyClient set, use RosettyProvider to set one"); | ||
} | ||
return client(); | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
RosettyContext, | ||
RosettyProvider, | ||
useRosetty | ||
}); |
{ | ||
"version": "1.0.34", | ||
"version": "1.0.35", | ||
"license": "MIT", | ||
@@ -21,14 +21,5 @@ "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": { | ||
"hooks": { | ||
"pre-commit": "tsdx lint" | ||
"pre-commit": "pnpm lint" | ||
} | ||
@@ -103,11 +94,20 @@ }, | ||
"ts-jest": "^29.1.0", | ||
"tsdx": "0.14.1", | ||
"tslib": "2.6.2", | ||
"typescript": "5.2.2" | ||
"tsup": "^8.0.0", | ||
"typescript": "5.2.2", | ||
"babel-preset-solid": "^1.7.7" | ||
}, | ||
"peerDependencies": { | ||
"solid-js": "^1.7.11" | ||
}, | ||
"dependencies": { | ||
"babel-preset-solid": "^1.7.7", | ||
"rosetty": "^2.0.0", | ||
"solid-js": "^1.7.11" | ||
"rosetty": "^2.0.0" | ||
}, | ||
"scripts": { | ||
"build": "tsup src/index.tsx", | ||
"test": "jest", | ||
"lint": "eslint src test", | ||
"size": "size-limit", | ||
"analyze": "size-limit --why" | ||
} | ||
} | ||
} |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
22362
2
244
0
25
- Removedbabel-preset-solid@^1.7.7
- Removedsolid-js@^1.7.11
- Removed@ampproject/remapping@2.3.0(transitive)
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/compat-data@7.26.3(transitive)
- Removed@babel/core@7.26.0(transitive)
- Removed@babel/generator@7.26.3(transitive)
- Removed@babel/helper-compilation-targets@7.25.9(transitive)
- Removed@babel/helper-module-imports@7.18.67.25.9(transitive)
- Removed@babel/helper-module-transforms@7.26.0(transitive)
- Removed@babel/helper-plugin-utils@7.25.9(transitive)
- Removed@babel/helper-string-parser@7.25.9(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@babel/helper-validator-option@7.25.9(transitive)
- Removed@babel/helpers@7.26.0(transitive)
- Removed@babel/parser@7.26.3(transitive)
- Removed@babel/plugin-syntax-jsx@7.25.9(transitive)
- Removed@babel/template@7.25.9(transitive)
- Removed@babel/traverse@7.26.4(transitive)
- Removed@babel/types@7.26.3(transitive)
- Removed@jridgewell/gen-mapping@0.3.7(transitive)
- Removed@jridgewell/resolve-uri@3.1.2(transitive)
- Removed@jridgewell/sourcemap-codec@1.4.16-beta.01.5.0(transitive)
- Removed@jridgewell/trace-mapping@0.3.25(transitive)
- Removedbabel-plugin-jsx-dom-expressions@0.39.3(transitive)
- Removedbabel-preset-solid@1.9.3(transitive)
- Removedbrowserslist@4.24.2(transitive)
- Removedcaniuse-lite@1.0.30001687(transitive)
- Removedconvert-source-map@2.0.0(transitive)
- Removeddebug@4.4.0(transitive)
- Removedelectron-to-chromium@1.5.72(transitive)
- Removedentities@4.5.0(transitive)
- Removedescalade@3.2.0(transitive)
- Removedgensync@1.0.0-beta.2(transitive)
- Removedglobals@11.12.0(transitive)
- Removedhtml-entities@2.3.3(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjsesc@3.1.0(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlru-cache@5.1.1(transitive)
- Removedms@2.1.3(transitive)
- Removednode-releases@2.0.19(transitive)
- Removedparse5@7.2.1(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedsemver@6.3.1(transitive)
- Removedupdate-browserslist-db@1.1.1(transitive)
- Removedvalidate-html-nesting@1.2.2(transitive)
- Removedyallist@3.1.1(transitive)