@arcanejs/toolkit 3.0.0 → 3.1.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.
@@ -1,8 +1,16 @@
1
+ import { Theme } from '@arcanejs/toolkit-frontend/styling';
1
2
  import { FrontendComponentRenderers } from '@arcanejs/toolkit-frontend/types';
2
3
 
3
- type ArcaneFrontendOptions = {
4
+ type Props = {
5
+ className?: string;
4
6
  renderers: FrontendComponentRenderers;
7
+ themes?: {
8
+ dark: Theme;
9
+ light: Theme;
10
+ };
5
11
  };
12
+
13
+ type ArcaneFrontendOptions = Pick<Props, 'renderers' | 'themes'>;
6
14
  declare const startArcaneFrontend: (opts: ArcaneFrontendOptions) => void;
7
15
 
8
16
  export { type ArcaneFrontendOptions, startArcaneFrontend };
@@ -1,8 +1,16 @@
1
+ import { Theme } from '@arcanejs/toolkit-frontend/styling';
1
2
  import { FrontendComponentRenderers } from '@arcanejs/toolkit-frontend/types';
2
3
 
3
- type ArcaneFrontendOptions = {
4
+ type Props = {
5
+ className?: string;
4
6
  renderers: FrontendComponentRenderers;
7
+ themes?: {
8
+ dark: Theme;
9
+ light: Theme;
10
+ };
5
11
  };
12
+
13
+ type ArcaneFrontendOptions = Pick<Props, 'renderers' | 'themes'>;
6
14
  declare const startArcaneFrontend: (opts: ArcaneFrontendOptions) => void;
7
15
 
8
16
  export { type ArcaneFrontendOptions, startArcaneFrontend };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/frontend/index.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/frontend/index.ts
2
2
  var _client = require('react-dom/client');
3
3
  var _util = require('@arcanejs/toolkit-frontend/util');
4
4
 
@@ -337,11 +337,18 @@ var StyledStage = _styledcomponents.styled.call(void 0, Stage)`
337
337
  padding: ${(p) => p.theme.sizingPx.spacing}px;
338
338
  `;
339
339
  function rootComponent(props) {
340
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, PreferredThemeProvider, { dark: _styling.DARK_THEME, light: _styling.LIGHT_THEME, children: [
341
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _styling.BaseStyle, {}),
342
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _styling.GlobalStyle, {}),
343
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledStage, { ...props })
344
- ] });
340
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
341
+ PreferredThemeProvider,
342
+ {
343
+ dark: _nullishCoalesce(_optionalChain([props, 'access', _ => _.themes, 'optionalAccess', _2 => _2.dark]), () => ( _styling.DARK_THEME)),
344
+ light: _nullishCoalesce(_optionalChain([props, 'access', _3 => _3.themes, 'optionalAccess', _4 => _4.light]), () => ( _styling.LIGHT_THEME)),
345
+ children: [
346
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _styling.BaseStyle, {}),
347
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _styling.GlobalStyle, {}),
348
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StyledStage, { ...props })
349
+ ]
350
+ }
351
+ );
345
352
  }
346
353
 
347
354
  // src/frontend/index.ts
@@ -337,11 +337,18 @@ var StyledStage = styled(Stage)`
337
337
  padding: ${(p) => p.theme.sizingPx.spacing}px;
338
338
  `;
339
339
  function rootComponent(props) {
340
- return /* @__PURE__ */ jsxs(PreferredThemeProvider, { dark: DARK_THEME2, light: LIGHT_THEME2, children: [
341
- /* @__PURE__ */ jsx2(BaseStyle2, {}),
342
- /* @__PURE__ */ jsx2(GlobalStyle2, {}),
343
- /* @__PURE__ */ jsx2(StyledStage, { ...props })
344
- ] });
340
+ return /* @__PURE__ */ jsxs(
341
+ PreferredThemeProvider,
342
+ {
343
+ dark: props.themes?.dark ?? DARK_THEME2,
344
+ light: props.themes?.light ?? LIGHT_THEME2,
345
+ children: [
346
+ /* @__PURE__ */ jsx2(BaseStyle2, {}),
347
+ /* @__PURE__ */ jsx2(GlobalStyle2, {}),
348
+ /* @__PURE__ */ jsx2(StyledStage, { ...props })
349
+ ]
350
+ }
351
+ );
345
352
  }
346
353
 
347
354
  // src/frontend/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcanejs/toolkit",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "private": false,
5
5
  "description": "Build web-accessible control interfaces for your long-running Node.js processes",
6
6
  "keywords": [
@@ -115,7 +115,7 @@
115
115
  "tsup": "^8.1.0",
116
116
  "typescript": "^5.3.3",
117
117
  "@arcanejs/eslint-config": "^0.0.0",
118
- "@arcanejs/toolkit-frontend": "^0.5.0",
118
+ "@arcanejs/toolkit-frontend": "^0.6.0",
119
119
  "@arcanejs/typescript-config": "^0.0.0"
120
120
  },
121
121
  "dependencies": {
@@ -132,7 +132,7 @@
132
132
  "react": "^18",
133
133
  "react-dom": "18.3.1",
134
134
  "styled-components": "^6.1.13",
135
- "@arcanejs/toolkit-frontend": "^0.5.0"
135
+ "@arcanejs/toolkit-frontend": "^0.6.0"
136
136
  },
137
137
  "peerDependenciesMeta": {
138
138
  "@arcanejs/toolkit-frontend": {