simplestyle-js 5.4.4-beta.1 → 5.4.4-beta.2
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/cjs/next/ClientBoundary.cjs +6 -13
- package/dist/cjs/next/ClientBoundary.d.ts +4 -2
- package/dist/cjs/next/SimpleStyleProvider.cjs +8 -7
- package/dist/cjs/next/SimpleStyleProvider.d.ts +4 -2
- package/dist/esm/next/ClientBoundary.d.ts +4 -2
- package/dist/esm/next/ClientBoundary.mjs +7 -17
- package/dist/esm/next/SimpleStyleProvider.d.ts +4 -2
- package/dist/esm/next/SimpleStyleProvider.mjs +9 -8
- package/package.json +1 -11
- package/dist/cjs/next/IHateNextJsContext.cjs +0 -12
- package/dist/cjs/next/IHateNextJsContext.d.ts +0 -5
- package/dist/esm/next/IHateNextJsContext.d.ts +0 -5
- package/dist/esm/next/IHateNextJsContext.mjs +0 -2
|
@@ -10,18 +10,11 @@ Object.defineProperty(exports, "ClientBoundary", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
const _jsxruntime = require("react/jsx-runtime");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: [
|
|
20
|
-
ctx.registry.getRulesById().map(([ruleId, css])=>/*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
21
|
-
id: ruleId,
|
|
22
|
-
children: css
|
|
23
|
-
}, ruleId)),
|
|
24
|
-
children
|
|
25
|
-
]
|
|
13
|
+
function ClientBoundary({ rules }) {
|
|
14
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
|
|
15
|
+
children: rules.map(([ruleId, css])=>/*#__PURE__*/ (0, _jsxruntime.jsx)("style", {
|
|
16
|
+
id: ruleId,
|
|
17
|
+
children: css
|
|
18
|
+
}, ruleId))
|
|
26
19
|
});
|
|
27
20
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function ClientBoundary({
|
|
1
|
+
import type { SimpleStyleRegistry } from '../simpleStyleRegistry.js';
|
|
2
|
+
export declare function ClientBoundary({ rules, }: {
|
|
3
|
+
rules: ReturnType<SimpleStyleRegistry['getRulesById']>;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,12 +10,13 @@ Object.defineProperty(exports, "SimpleStyleProvider", {
|
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("react/jsx-runtime");
|
|
12
12
|
const _ClientBoundary = require("./ClientBoundary.cjs");
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
function SimpleStyleProvider({ children, registry }) {
|
|
14
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ClientBoundary.ClientBoundary, {
|
|
17
|
+
rules: registry.getRulesById()
|
|
18
|
+
}),
|
|
19
|
+
children
|
|
20
|
+
]
|
|
20
21
|
});
|
|
21
22
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { SimpleStyleRegistry } from '../simpleStyleRegistry.js';
|
|
3
3
|
/**
|
|
4
4
|
* Accumulates all CSS rules and writes
|
|
5
5
|
* them to your layout.
|
|
6
6
|
* Use this for Next.js or other Next.js-like frameworks
|
|
7
7
|
* that leverage React server components
|
|
8
8
|
*/
|
|
9
|
-
export declare function SimpleStyleProvider({ children,
|
|
9
|
+
export declare function SimpleStyleProvider({ children, registry, }: PropsWithChildren & {
|
|
10
|
+
registry: SimpleStyleRegistry;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function ClientBoundary({
|
|
1
|
+
import type { SimpleStyleRegistry } from '../simpleStyleRegistry.js';
|
|
2
|
+
export declare function ClientBoundary({ rules, }: {
|
|
3
|
+
rules: ReturnType<SimpleStyleRegistry['getRulesById']>;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const ctx = use(IHateNextJSContext);
|
|
10
|
-
if (!ctx) return null;
|
|
11
|
-
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
12
|
-
children: [
|
|
13
|
-
ctx.registry.getRulesById().map(([ruleId, css])=>/*#__PURE__*/ _jsx("style", {
|
|
14
|
-
id: ruleId,
|
|
15
|
-
children: css
|
|
16
|
-
}, ruleId)),
|
|
17
|
-
children
|
|
18
|
-
]
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
export function ClientBoundary({ rules }) {
|
|
4
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
5
|
+
children: rules.map(([ruleId, css])=>/*#__PURE__*/ _jsx("style", {
|
|
6
|
+
id: ruleId,
|
|
7
|
+
children: css
|
|
8
|
+
}, ruleId))
|
|
19
9
|
});
|
|
20
10
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { SimpleStyleRegistry } from '../simpleStyleRegistry.js';
|
|
3
3
|
/**
|
|
4
4
|
* Accumulates all CSS rules and writes
|
|
5
5
|
* them to your layout.
|
|
6
6
|
* Use this for Next.js or other Next.js-like frameworks
|
|
7
7
|
* that leverage React server components
|
|
8
8
|
*/
|
|
9
|
-
export declare function SimpleStyleProvider({ children,
|
|
9
|
+
export declare function SimpleStyleProvider({ children, registry, }: PropsWithChildren & {
|
|
10
|
+
registry: SimpleStyleRegistry;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ClientBoundary } from './ClientBoundary.mjs';
|
|
3
|
-
import { IHateNextJSContext } from './IHateNextJsContext.mjs';
|
|
4
3
|
/**
|
|
5
4
|
* Accumulates all CSS rules and writes
|
|
6
5
|
* them to your layout.
|
|
7
6
|
* Use this for Next.js or other Next.js-like frameworks
|
|
8
7
|
* that leverage React server components
|
|
9
|
-
*/ export function SimpleStyleProvider({ children,
|
|
10
|
-
return /*#__PURE__*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
*/ export function SimpleStyleProvider({ children, registry }) {
|
|
9
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ _jsx(ClientBoundary, {
|
|
12
|
+
rules: registry.getRulesById()
|
|
13
|
+
}),
|
|
14
|
+
children
|
|
15
|
+
]
|
|
15
16
|
});
|
|
16
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simplestyle-js",
|
|
3
|
-
"version": "5.4.4-beta.
|
|
3
|
+
"version": "5.4.4-beta.2",
|
|
4
4
|
"description": "An incredibly straightforward and simple CSS-in-JS solution with zero runtime dependencies, and out-of-the-box TypeScript support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -120,16 +120,6 @@
|
|
|
120
120
|
"default": "./dist/esm/next/ClientBoundary.mjs"
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
"./next/IHateNextJsContext": {
|
|
124
|
-
"require": {
|
|
125
|
-
"types": "./dist/cjs/next/IHateNextJsContext.d.ts",
|
|
126
|
-
"default": "./dist/cjs/next/IHateNextJsContext.cjs"
|
|
127
|
-
},
|
|
128
|
-
"import": {
|
|
129
|
-
"types": "./dist/esm/next/IHateNextJsContext.d.ts",
|
|
130
|
-
"default": "./dist/esm/next/IHateNextJsContext.mjs"
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
123
|
"./next/SimpleStyleProvider": {
|
|
134
124
|
"require": {
|
|
135
125
|
"types": "./dist/cjs/next/SimpleStyleProvider.d.ts",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "IHateNextJSContext", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return IHateNextJSContext;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _react = require("react");
|
|
12
|
-
const IHateNextJSContext = /*#__PURE__*/ (0, _react.createContext)(null);
|