@stackshift-ui/blockstyle 6.0.11 → 7.0.0-beta.1
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/blockstyle.js +1 -1
- package/dist/blockstyle.mjs +1 -1
- package/dist/chunk-Z7VMRX54.mjs +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +8 -8
- package/src/blockstyle.test.tsx +1 -1
- package/src/blockstyle.tsx +2 -2
- package/dist/chunk-INK7XA5Q.mjs +0 -1
package/dist/blockstyle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var l in o)n(e,l,{get:o[l],enumerable:!0})},w=(e,o,l,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of k(o))!N.call(e,m)&&m!==l&&n(e,m,{get:()=>o[m],enumerable:!(a=h(o,m))||a.enumerable});return e};var C=e=>w(n({},"__esModule",{value:!0}),e);var P={};T(P,{Blockstyle:()=>f});module.exports=C(P);var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var l in o)n(e,l,{get:o[l],enumerable:!0})},w=(e,o,l,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of k(o))!N.call(e,m)&&m!==l&&n(e,m,{get:()=>o[m],enumerable:!(a=h(o,m))||a.enumerable});return e};var C=e=>w(n({},"__esModule",{value:!0}),e);var P={};T(P,{Blockstyle:()=>f});module.exports=C(P);var x=require("@portabletext/react"),r=require("@stackshift-ui/system");var s=require("@stackshift-ui/heading"),c=require("@stackshift-ui/text"),d=require("@stackshift-ui/link"),p=require("@stackshift-ui/image"),t=require("react/jsx-runtime"),g={block:{h1:({children:e})=>(0,t.jsx)(s.Heading,{fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>(0,t.jsx)(s.Heading,{type:"h2",weight:"bold",fontSize:"2xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>(0,t.jsx)(s.Heading,{type:"h3",fontSize:"xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>(0,t.jsx)(s.Heading,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>(0,t.jsx)(c.Text,{className:"mb-8 leading-relaxed",children:e}),blockquote:({children:e})=>(0,t.jsxs)("blockquote",{className:"mb-6 italic leading-loose text-gray-500 px-14",children:["- ",e]})},code:({value:e})=>(0,t.jsx)("pre",{"data-language":e.language,children:(0,t.jsx)("code",{children:e.code})}),list:{bullet:({children:e})=>(0,t.jsx)("ul",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc",children:e}),number:({children:e})=>(0,t.jsx)("ol",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal",children:e})},listItem:{bullet:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),number:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e})},marks:{strong:({children:e})=>(0,t.jsx)("strong",{children:e}),em:({children:e})=>(0,t.jsx)("em",{children:e}),code:({children:e})=>(0,t.jsx)("code",{children:e}),link:({children:e,value:o})=>(0,t.jsx)(d.Link,{className:"hover:text-primary-foreground text-primary",href:o.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var o,l,a;return(0,t.jsx)(p.Image,{className:"w-full h-full mb-5",width:500,height:500,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",src:e==null?void 0:e.image,alt:(a=e==null?void 0:e.alt)!=null?a:(l=(o=e==null?void 0:e.image)==null?void 0:o.asset)==null?void 0:l._ref})}}};var b="Blockstyle",f=({children:e,className:o,as:l,content:a,...m})=>{let{[b]:y=r.DefaultComponent}=(0,r.useStackShiftUIComponents)();return(0,t.jsx)(y,{as:l,className:o,...m,children:a?(0,t.jsx)(x.PortableText,{value:a,components:g}):e})};f.displayName=b;0&&(module.exports={Blockstyle});
|
package/dist/blockstyle.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-Z7VMRX54.mjs";import"./chunk-GLR2G3MJ.mjs";export{a as Blockstyle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-GLR2G3MJ.mjs";import{PortableText as r}from"@portabletext/react";import{DefaultComponent as c,useStackShiftUIComponents as y}from"@stackshift-ui/system";import{jsx as o}from"react/jsx-runtime";var s="Blockstyle",i=({children:l,className:a,as:n,content:e,...m})=>{let{[s]:p=c}=y();return o(p,{as:n,className:a,...m,children:e?o(r,{value:e,components:t}):l})};i.displayName=s;export{i as a};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var l in o)i(e,l,{get:o[l],enumerable:!0})},w=(e,o,l,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of k(o))!N.call(e,m)&&m!==l&&i(e,m,{get:()=>o[m],enumerable:!(a=h(o,m))||a.enumerable});return e};var S=e=>w(i({},"__esModule",{value:!0}),e);var C={};T(C,{Blockstyle:()=>
|
|
2
|
+
"use strict";var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var l in o)i(e,l,{get:o[l],enumerable:!0})},w=(e,o,l,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let m of k(o))!N.call(e,m)&&m!==l&&i(e,m,{get:()=>o[m],enumerable:!(a=h(o,m))||a.enumerable});return e};var S=e=>w(i({},"__esModule",{value:!0}),e);var C={};T(C,{Blockstyle:()=>d,defaultBlockStyle:()=>s});module.exports=S(C);var f=require("@portabletext/react"),n=require("@stackshift-ui/system");var r=require("@stackshift-ui/heading"),p=require("@stackshift-ui/text"),g=require("@stackshift-ui/link"),x=require("@stackshift-ui/image"),t=require("react/jsx-runtime"),s={block:{h1:({children:e})=>(0,t.jsx)(r.Heading,{fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>(0,t.jsx)(r.Heading,{type:"h2",weight:"bold",fontSize:"2xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>(0,t.jsx)(r.Heading,{type:"h3",fontSize:"xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>(0,t.jsx)(r.Heading,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>(0,t.jsx)(p.Text,{className:"mb-8 leading-relaxed",children:e}),blockquote:({children:e})=>(0,t.jsxs)("blockquote",{className:"mb-6 italic leading-loose text-gray-500 px-14",children:["- ",e]})},code:({value:e})=>(0,t.jsx)("pre",{"data-language":e.language,children:(0,t.jsx)("code",{children:e.code})}),list:{bullet:({children:e})=>(0,t.jsx)("ul",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc",children:e}),number:({children:e})=>(0,t.jsx)("ol",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal",children:e})},listItem:{bullet:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),number:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e})},marks:{strong:({children:e})=>(0,t.jsx)("strong",{children:e}),em:({children:e})=>(0,t.jsx)("em",{children:e}),code:({children:e})=>(0,t.jsx)("code",{children:e}),link:({children:e,value:o})=>(0,t.jsx)(g.Link,{className:"hover:text-primary-foreground text-primary",href:o.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var o,l,a;return(0,t.jsx)(x.Image,{className:"w-full h-full mb-5",width:500,height:500,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",src:e==null?void 0:e.image,alt:(a=e==null?void 0:e.alt)!=null?a:(l=(o=e==null?void 0:e.image)==null?void 0:o.asset)==null?void 0:l._ref})}}};var b="Blockstyle",d=({children:e,className:o,as:l,content:a,...m})=>{let{[b]:y=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,t.jsx)(y,{as:l,className:o,...m,children:a?(0,t.jsx)(f.PortableText,{value:a,components:s}):e})};d.displayName=b;0&&(module.exports={Blockstyle,defaultBlockStyle});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as l}from"./chunk-
|
|
2
|
+
"use strict";import{a as l}from"./chunk-Z7VMRX54.mjs";import{a as e}from"./chunk-GLR2G3MJ.mjs";export{l as Blockstyle,e as defaultBlockStyle};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/blockstyle",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-beta.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@portabletext/react": "^3.1.0",
|
|
37
|
-
"@stackshift-ui/
|
|
38
|
-
"@stackshift-ui/
|
|
39
|
-
"@stackshift-ui/
|
|
40
|
-
"@stackshift-ui/
|
|
41
|
-
"@stackshift-ui/
|
|
42
|
-
"@stackshift-ui/
|
|
37
|
+
"@stackshift-ui/image": "6.1.0-beta.1",
|
|
38
|
+
"@stackshift-ui/scripts": "6.1.0-beta.0",
|
|
39
|
+
"@stackshift-ui/link": "6.0.12-beta.1",
|
|
40
|
+
"@stackshift-ui/heading": "7.0.0-beta.1",
|
|
41
|
+
"@stackshift-ui/system": "6.1.0-beta.1",
|
|
42
|
+
"@stackshift-ui/text": "7.0.0-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@stackshift-ui/system": ">=6.0.
|
|
45
|
+
"@stackshift-ui/system": ">=6.1.0-beta.1",
|
|
46
46
|
"@types/react": "16.8 - 19",
|
|
47
47
|
"next": "10 - 14",
|
|
48
48
|
"react": "16.8 - 19",
|
package/src/blockstyle.test.tsx
CHANGED
|
@@ -7,7 +7,7 @@ describe.concurrent("blockstyle", () => {
|
|
|
7
7
|
|
|
8
8
|
test("Common: Blockstyle - test if renders without errors", ({ expect }) => {
|
|
9
9
|
const clx = "blockStyle-class";
|
|
10
|
-
render(<Blockstyle className={clx} />);
|
|
10
|
+
render(<Blockstyle data-testid="div" className={clx} />);
|
|
11
11
|
|
|
12
12
|
expect(screen.getByTestId("div").classList).toContain(clx);
|
|
13
13
|
});
|
package/src/blockstyle.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { PortableText } from "@portabletext/react";
|
|
1
2
|
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
2
3
|
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
3
|
-
import { PortableText } from "@portabletext/react";
|
|
4
4
|
import { defaultBlockStyle } from "./defaultBlockStyle";
|
|
5
5
|
|
|
6
6
|
export interface BlockstyleProps extends Omit<HTMLProps<HTMLElement>, "as"> {
|
|
@@ -22,7 +22,7 @@ export const Blockstyle: React.FC<BlockstyleProps> = ({
|
|
|
22
22
|
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<Component as={as} className={className} {...props}
|
|
25
|
+
<Component as={as} className={className} {...props}>
|
|
26
26
|
{content ? <PortableText value={content} components={defaultBlockStyle} /> : children}
|
|
27
27
|
</Component>
|
|
28
28
|
);
|
package/dist/chunk-INK7XA5Q.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-GLR2G3MJ.mjs";import{DefaultComponent as r,useStackShiftUIComponents as c}from"@stackshift-ui/system";import{PortableText as i}from"@portabletext/react";import{jsx as s}from"react/jsx-runtime";var e="Blockstyle",y=({children:a,className:l,as:n,content:t,...m})=>{let{[e]:p=r}=c();return s(p,{as:n,className:l,...m,"data-testid":e,children:t?s(i,{value:t,components:o}):a})};y.displayName=e;export{y as a};
|