@stackshift-ui/blockstyle 7.0.0-beta.0 → 7.0.0-beta.3

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 +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 r=require("@stackshift-ui/system"),b=require("@portabletext/react");var s=require("@stackshift-ui/heading"),d=require("@stackshift-ui/text"),p=require("@stackshift-ui/link"),g=require("@stackshift-ui/image"),t=require("react/jsx-runtime"),x={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)(d.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)(p.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)(g.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 i="Blockstyle",f=({children:e,className:o,as:l,content:a,...m})=>{let{[i]:y=r.DefaultComponent}=(0,r.useStackShiftUIComponents)();return(0,t.jsx)(y,{as:l,className:o,...m,"data-testid":i,children:a?(0,t.jsx)(b.PortableText,{value:a,components:x}):e})};f.displayName=i;0&&(module.exports={Blockstyle});
1
+ "use strict";var r=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)r(e,o,{get:l[o],enumerable:!0})},T=(e,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let m of k(l))!N.call(e,m)&&m!==o&&r(e,m,{get:()=>l[m],enumerable:!(a=y(l,m))||a.enumerable});return e};var S=e=>T(r({},"__esModule",{value:!0}),e);var H={};w(H,{Blockstyle:()=>f});module.exports=S(H);var x=require("@portabletext/react"),s=require("@stackshift-ui/system");var n=require("@stackshift-ui/heading"),c=require("@stackshift-ui/image"),d=require("@stackshift-ui/link"),p=require("@stackshift-ui/text"),t=require("react/jsx-runtime"),g={block:{h1:({children:e})=>(0,t.jsx)(n.Heading,{fontSize:"5xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>(0,t.jsx)(n.Heading,{type:"h2",weight:"bold",fontSize:"4xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>(0,t.jsx)(n.Heading,{type:"h3",fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>(0,t.jsx)(n.Heading,{type:"h4",weight:"bold",fontSize:"2xl",className:"mb-8 leading-normal text-black",children:e}),h5:({children:e})=>(0,t.jsx)(n.Heading,{type:"h4",weight:"bold",fontSize:"xl",className:"mb-8 leading-normal text-black",children:e}),h6:({children:e})=>(0,t.jsx)(n.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:l})=>(0,t.jsx)(d.Link,{className:"hover:text-primary-foreground text-primary",href:l.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var l,o,a;return(0,t.jsx)(c.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:(o=(l=e==null?void 0:e.image)==null?void 0:l.asset)==null?void 0:o._ref})}}};var b="Blockstyle",f=({children:e,className:l,as:o,content:a,...m})=>{let{[b]:h=s.DefaultComponent}=(0,s.useStackShiftUIComponents)();return(0,t.jsx)(h,{as:o,className:l,...m,children:a?(0,t.jsx)(x.PortableText,{value:a,components:g}):e})};f.displayName=b;0&&(module.exports={Blockstyle});
@@ -1 +1 @@
1
- import{a}from"./chunk-INK7XA5Q.mjs";import"./chunk-GLR2G3MJ.mjs";export{a as Blockstyle};
1
+ import{a}from"./chunk-34BAENR7.mjs";import"./chunk-MWQ5ZP4S.mjs";export{a as Blockstyle};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-MWQ5ZP4S.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};
@@ -0,0 +1,65 @@
1
+ // src/defaultBlockStyle.tsx
2
+ import { Heading } from "@stackshift-ui/heading";
3
+ import { Image } from "@stackshift-ui/image";
4
+ import { Link } from "@stackshift-ui/link";
5
+ import { Text } from "@stackshift-ui/text";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var defaultBlockStyle = {
8
+ block: {
9
+ h1: ({ children }) => /* @__PURE__ */ jsx(Heading, { fontSize: "5xl", weight: "bold", className: "mb-8 leading-normal text-black", children }),
10
+ h2: ({ children }) => /* @__PURE__ */ jsx(Heading, { type: "h2", weight: "bold", fontSize: "4xl", className: "mb-8 text-black", children }),
11
+ h3: ({ children }) => /* @__PURE__ */ jsx(Heading, { type: "h3", fontSize: "3xl", weight: "bold", className: "mb-8 leading-normal text-black", children }),
12
+ h4: ({ children }) => /* @__PURE__ */ jsx(Heading, { type: "h4", weight: "bold", fontSize: "2xl", className: "mb-8 leading-normal text-black", children }),
13
+ h5: ({ children }) => /* @__PURE__ */ jsx(Heading, { type: "h4", weight: "bold", fontSize: "xl", className: "mb-8 leading-normal text-black", children }),
14
+ h6: ({ children }) => /* @__PURE__ */ jsx(Heading, { type: "h4", weight: "bold", fontSize: "lg", className: "mb-8 leading-normal text-black", children }),
15
+ normal: ({ children }) => /* @__PURE__ */ jsx(Text, { className: "mb-8 leading-relaxed", children }),
16
+ blockquote: ({ children }) => /* @__PURE__ */ jsxs("blockquote", { className: "mb-6 italic leading-loose text-gray-500 px-14", children: [
17
+ "- ",
18
+ children
19
+ ] })
20
+ },
21
+ code: ({ value }) => /* @__PURE__ */ jsx("pre", { "data-language": value.language, children: /* @__PURE__ */ jsx("code", { children: value.code }) }),
22
+ list: {
23
+ bullet: ({ children }) => /* @__PURE__ */ jsx("ul", { className: "flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc", children }),
24
+ number: ({ children }) => /* @__PURE__ */ jsx("ol", { className: "flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal", children })
25
+ },
26
+ listItem: {
27
+ bullet: ({ children }) => /* @__PURE__ */ jsx("li", { className: "leading-relaxed", children }),
28
+ number: ({ children }) => /* @__PURE__ */ jsx("li", { className: "leading-relaxed", children })
29
+ },
30
+ marks: {
31
+ strong: ({ children }) => /* @__PURE__ */ jsx("strong", { children }),
32
+ em: ({ children }) => /* @__PURE__ */ jsx("em", { children }),
33
+ code: ({ children }) => /* @__PURE__ */ jsx("code", { children }),
34
+ link: ({ children, value }) => /* @__PURE__ */ jsx(
35
+ Link,
36
+ {
37
+ className: "hover:text-primary-foreground text-primary",
38
+ href: value.href,
39
+ target: "_blank",
40
+ rel: "noopener noreferrer",
41
+ children
42
+ }
43
+ )
44
+ },
45
+ types: {
46
+ addImage: ({ value }) => {
47
+ var _a, _b, _c;
48
+ return /* @__PURE__ */ jsx(
49
+ Image,
50
+ {
51
+ className: "w-full h-full mb-5",
52
+ width: 500,
53
+ height: 500,
54
+ sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
55
+ src: value == null ? void 0 : value.image,
56
+ alt: (_c = value == null ? void 0 : value.alt) != null ? _c : (_b = (_a = value == null ? void 0 : value.image) == null ? void 0 : _a.asset) == null ? void 0 : _b._ref
57
+ }
58
+ );
59
+ }
60
+ }
61
+ };
62
+
63
+ export {
64
+ defaultBlockStyle
65
+ };
@@ -0,0 +1 @@
1
+ import{Heading as t}from"@stackshift-ui/heading";import{Image as i}from"@stackshift-ui/image";import{Link as n}from"@stackshift-ui/link";import{Text as r}from"@stackshift-ui/text";import{jsx as l,jsxs as s}from"react/jsx-runtime";var x={block:{h1:({children:e})=>l(t,{fontSize:"5xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>l(t,{type:"h2",weight:"bold",fontSize:"4xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>l(t,{type:"h3",fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>l(t,{type:"h4",weight:"bold",fontSize:"2xl",className:"mb-8 leading-normal text-black",children:e}),h5:({children:e})=>l(t,{type:"h4",weight:"bold",fontSize:"xl",className:"mb-8 leading-normal text-black",children:e}),h6:({children:e})=>l(t,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>l(r,{className:"mb-8 leading-relaxed",children:e}),blockquote:({children:e})=>s("blockquote",{className:"mb-6 italic leading-loose text-gray-500 px-14",children:["- ",e]})},code:({value:e})=>l("pre",{"data-language":e.language,children:l("code",{children:e.code})}),list:{bullet:({children:e})=>l("ul",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc",children:e}),number:({children:e})=>l("ol",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal",children:e})},listItem:{bullet:({children:e})=>l("li",{className:"leading-relaxed",children:e}),number:({children:e})=>l("li",{className:"leading-relaxed",children:e})},marks:{strong:({children:e})=>l("strong",{children:e}),em:({children:e})=>l("em",{children:e}),code:({children:e})=>l("code",{children:e}),link:({children:e,value:a})=>l(n,{className:"hover:text-primary-foreground text-primary",href:a.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var a,o,m;return l(i,{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:(m=e==null?void 0:e.alt)!=null?m:(o=(a=e==null?void 0:e.image)==null?void 0:a.asset)==null?void 0:o._ref})}}};export{x as a};
@@ -0,0 +1,24 @@
1
+ import {
2
+ defaultBlockStyle
3
+ } from "./chunk-MR5EDJ66.mjs";
4
+
5
+ // src/blockstyle.tsx
6
+ import { PortableText } from "@portabletext/react";
7
+ import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
8
+ import { jsx } from "react/jsx-runtime";
9
+ var displayName = "Blockstyle";
10
+ var Blockstyle = ({
11
+ children,
12
+ className,
13
+ as,
14
+ content,
15
+ ...props
16
+ }) => {
17
+ const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
18
+ return /* @__PURE__ */ jsx(Component, { as, className, ...props, children: content ? /* @__PURE__ */ jsx(PortableText, { value: content, components: defaultBlockStyle }) : children });
19
+ };
20
+ Blockstyle.displayName = displayName;
21
+
22
+ export {
23
+ Blockstyle
24
+ };
@@ -1 +1 @@
1
- "use strict";var r=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var a in t)r(e,a,{get:t[a],enumerable:!0})},p=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of g(t))!x.call(e,m)&&m!==a&&r(e,m,{get:()=>t[m],enumerable:!(o=c(t,m))||o.enumerable});return e};var f=e=>p(r({},"__esModule",{value:!0}),e);var k={};b(k,{defaultBlockStyle:()=>h});module.exports=f(k);var i=require("@stackshift-ui/heading"),n=require("@stackshift-ui/text"),s=require("@stackshift-ui/link"),d=require("@stackshift-ui/image"),l=require("react/jsx-runtime"),h={block:{h1:({children:e})=>(0,l.jsx)(i.Heading,{fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>(0,l.jsx)(i.Heading,{type:"h2",weight:"bold",fontSize:"2xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>(0,l.jsx)(i.Heading,{type:"h3",fontSize:"xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>(0,l.jsx)(i.Heading,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>(0,l.jsx)(n.Text,{className:"mb-8 leading-relaxed",children:e}),blockquote:({children:e})=>(0,l.jsxs)("blockquote",{className:"mb-6 italic leading-loose text-gray-500 px-14",children:["- ",e]})},code:({value:e})=>(0,l.jsx)("pre",{"data-language":e.language,children:(0,l.jsx)("code",{children:e.code})}),list:{bullet:({children:e})=>(0,l.jsx)("ul",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc",children:e}),number:({children:e})=>(0,l.jsx)("ol",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal",children:e})},listItem:{bullet:({children:e})=>(0,l.jsx)("li",{className:"leading-relaxed",children:e}),number:({children:e})=>(0,l.jsx)("li",{className:"leading-relaxed",children:e})},marks:{strong:({children:e})=>(0,l.jsx)("strong",{children:e}),em:({children:e})=>(0,l.jsx)("em",{children:e}),code:({children:e})=>(0,l.jsx)("code",{children:e}),link:({children:e,value:t})=>(0,l.jsx)(s.Link,{className:"hover:text-primary-foreground text-primary",href:t.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var t,a,o;return(0,l.jsx)(d.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:(o=e==null?void 0:e.alt)!=null?o:(a=(t=e==null?void 0:e.image)==null?void 0:t.asset)==null?void 0:a._ref})}}};0&&(module.exports={defaultBlockStyle});
1
+ "use strict";var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var a in t)n(e,a,{get:t[a],enumerable:!0})},p=(e,t,a,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of c(t))!b.call(e,i)&&i!==a&&n(e,i,{get:()=>t[i],enumerable:!(m=g(t,i))||m.enumerable});return e};var h=e=>p(n({},"__esModule",{value:!0}),e);var k={};x(k,{defaultBlockStyle:()=>f});module.exports=h(k);var o=require("@stackshift-ui/heading"),r=require("@stackshift-ui/image"),s=require("@stackshift-ui/link"),d=require("@stackshift-ui/text"),l=require("react/jsx-runtime"),f={block:{h1:({children:e})=>(0,l.jsx)(o.Heading,{fontSize:"5xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>(0,l.jsx)(o.Heading,{type:"h2",weight:"bold",fontSize:"4xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>(0,l.jsx)(o.Heading,{type:"h3",fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>(0,l.jsx)(o.Heading,{type:"h4",weight:"bold",fontSize:"2xl",className:"mb-8 leading-normal text-black",children:e}),h5:({children:e})=>(0,l.jsx)(o.Heading,{type:"h4",weight:"bold",fontSize:"xl",className:"mb-8 leading-normal text-black",children:e}),h6:({children:e})=>(0,l.jsx)(o.Heading,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>(0,l.jsx)(d.Text,{className:"mb-8 leading-relaxed",children:e}),blockquote:({children:e})=>(0,l.jsxs)("blockquote",{className:"mb-6 italic leading-loose text-gray-500 px-14",children:["- ",e]})},code:({value:e})=>(0,l.jsx)("pre",{"data-language":e.language,children:(0,l.jsx)("code",{children:e.code})}),list:{bullet:({children:e})=>(0,l.jsx)("ul",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc",children:e}),number:({children:e})=>(0,l.jsx)("ol",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal",children:e})},listItem:{bullet:({children:e})=>(0,l.jsx)("li",{className:"leading-relaxed",children:e}),number:({children:e})=>(0,l.jsx)("li",{className:"leading-relaxed",children:e})},marks:{strong:({children:e})=>(0,l.jsx)("strong",{children:e}),em:({children:e})=>(0,l.jsx)("em",{children:e}),code:({children:e})=>(0,l.jsx)("code",{children:e}),link:({children:e,value:t})=>(0,l.jsx)(s.Link,{className:"hover:text-primary-foreground text-primary",href:t.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var t,a,m;return(0,l.jsx)(r.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:(m=e==null?void 0:e.alt)!=null?m:(a=(t=e==null?void 0:e.image)==null?void 0:t.asset)==null?void 0:a._ref})}}};0&&(module.exports={defaultBlockStyle});
@@ -1 +1 @@
1
- import{a}from"./chunk-GLR2G3MJ.mjs";export{a as defaultBlockStyle};
1
+ import{a}from"./chunk-MWQ5ZP4S.mjs";export{a as defaultBlockStyle};
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:()=>p,defaultBlockStyle:()=>s});module.exports=S(C);var n=require("@stackshift-ui/system"),b=require("@portabletext/react");var r=require("@stackshift-ui/heading"),g=require("@stackshift-ui/text"),x=require("@stackshift-ui/link"),f=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)(g.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)(x.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)(f.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 c="Blockstyle",p=({children:e,className:o,as:l,content:a,...m})=>{let{[c]:y=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,t.jsx)(y,{as:l,className:o,...m,"data-testid":c,children:a?(0,t.jsx)(b.PortableText,{value:a,components:s}):e})};p.displayName=c;0&&(module.exports={Blockstyle,defaultBlockStyle});
2
+ "use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var w=(e,l)=>{for(var o in l)i(e,o,{get:l[o],enumerable:!0})},S=(e,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let m of k(l))!N.call(e,m)&&m!==o&&i(e,m,{get:()=>l[m],enumerable:!(a=y(l,m))||a.enumerable});return e};var T=e=>S(i({},"__esModule",{value:!0}),e);var H={};w(H,{Blockstyle:()=>d,defaultBlockStyle:()=>s});module.exports=T(H);var b=require("@portabletext/react"),r=require("@stackshift-ui/system");var n=require("@stackshift-ui/heading"),p=require("@stackshift-ui/image"),g=require("@stackshift-ui/link"),x=require("@stackshift-ui/text"),t=require("react/jsx-runtime"),s={block:{h1:({children:e})=>(0,t.jsx)(n.Heading,{fontSize:"5xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>(0,t.jsx)(n.Heading,{type:"h2",weight:"bold",fontSize:"4xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>(0,t.jsx)(n.Heading,{type:"h3",fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>(0,t.jsx)(n.Heading,{type:"h4",weight:"bold",fontSize:"2xl",className:"mb-8 leading-normal text-black",children:e}),h5:({children:e})=>(0,t.jsx)(n.Heading,{type:"h4",weight:"bold",fontSize:"xl",className:"mb-8 leading-normal text-black",children:e}),h6:({children:e})=>(0,t.jsx)(n.Heading,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>(0,t.jsx)(x.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:l})=>(0,t.jsx)(g.Link,{className:"hover:text-primary-foreground text-primary",href:l.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var l,o,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:(o=(l=e==null?void 0:e.image)==null?void 0:l.asset)==null?void 0:o._ref})}}};var f="Blockstyle",d=({children:e,className:l,as:o,content:a,...m})=>{let{[f]:h=r.DefaultComponent}=(0,r.useStackShiftUIComponents)();return(0,t.jsx)(h,{as:o,className:l,...m,children:a?(0,t.jsx)(b.PortableText,{value:a,components:s}):e})};d.displayName=f;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-INK7XA5Q.mjs";import{a as e}from"./chunk-GLR2G3MJ.mjs";export{l as Blockstyle,e as defaultBlockStyle};
2
+ "use strict";import{a as l}from"./chunk-34BAENR7.mjs";import{a as e}from"./chunk-MWQ5ZP4S.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": "7.0.0-beta.0",
4
+ "version": "7.0.0-beta.3",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -29,20 +29,20 @@
29
29
  "typescript": "^5.6.2",
30
30
  "vite-tsconfig-paths": "^5.0.1",
31
31
  "vitest": "^2.1.1",
32
- "@stackshift-ui/typescript-config": "6.0.10",
33
- "@stackshift-ui/eslint-config": "6.0.10"
32
+ "@stackshift-ui/eslint-config": "6.0.10",
33
+ "@stackshift-ui/typescript-config": "6.0.10"
34
34
  },
35
35
  "dependencies": {
36
36
  "@portabletext/react": "^3.1.0",
37
- "@stackshift-ui/system": "6.1.0-beta.0",
38
- "@stackshift-ui/link": "6.0.12-beta.0",
39
- "@stackshift-ui/scripts": "6.1.0-beta.0",
40
- "@stackshift-ui/text": "7.0.0-beta.0",
41
- "@stackshift-ui/heading": "7.0.0-beta.0",
42
- "@stackshift-ui/image": "6.1.0-beta.0"
37
+ "@stackshift-ui/image": "6.1.0-beta.3",
38
+ "@stackshift-ui/link": "6.1.0-beta.3",
39
+ "@stackshift-ui/heading": "7.0.0-beta.3",
40
+ "@stackshift-ui/system": "6.1.0-beta.3",
41
+ "@stackshift-ui/text": "7.0.0-beta.3",
42
+ "@stackshift-ui/scripts": "6.1.0-beta.2"
43
43
  },
44
44
  "peerDependencies": {
45
- "@stackshift-ui/system": ">=6.1.0-beta.0",
45
+ "@stackshift-ui/system": ">=6.1.0-beta.3",
46
46
  "@types/react": "16.8 - 19",
47
47
  "next": "10 - 14",
48
48
  "react": "16.8 - 19",
@@ -1,8 +1,8 @@
1
+ import { PortableTextComponents } from "@portabletext/react";
1
2
  import { Heading } from "@stackshift-ui/heading";
2
- import { Text } from "@stackshift-ui/text";
3
- import { Link } from "@stackshift-ui/link";
4
3
  import { Image } from "@stackshift-ui/image";
5
- import { PortableTextComponents } from "@portabletext/react";
4
+ import { Link } from "@stackshift-ui/link";
5
+ import { Text } from "@stackshift-ui/text";
6
6
 
7
7
  export type MyPortableTextComponents = PortableTextComponents & {
8
8
  code?: ({ value }: { value: { language?: string; code?: string } }) => JSX.Element;
@@ -11,21 +11,31 @@ export type MyPortableTextComponents = PortableTextComponents & {
11
11
  export const defaultBlockStyle: MyPortableTextComponents = {
12
12
  block: {
13
13
  h1: ({ children }) => (
14
- <Heading fontSize="3xl" weight="bold" className="mb-8 leading-normal text-black">
14
+ <Heading fontSize="5xl" weight="bold" className="mb-8 leading-normal text-black">
15
15
  {children}
16
16
  </Heading>
17
17
  ),
18
18
  h2: ({ children }) => (
19
- <Heading type="h2" weight="bold" fontSize="2xl" className="mb-8 text-black">
19
+ <Heading type="h2" weight="bold" fontSize="4xl" className="mb-8 text-black">
20
20
  {children}
21
21
  </Heading>
22
22
  ),
23
23
  h3: ({ children }) => (
24
- <Heading type="h3" fontSize="xl" weight="bold" className="mb-8 leading-normal text-black">
24
+ <Heading type="h3" fontSize="3xl" weight="bold" className="mb-8 leading-normal text-black">
25
25
  {children}
26
26
  </Heading>
27
27
  ),
28
28
  h4: ({ children }) => (
29
+ <Heading type="h4" weight="bold" fontSize="2xl" className="mb-8 leading-normal text-black">
30
+ {children}
31
+ </Heading>
32
+ ),
33
+ h5: ({ children }) => (
34
+ <Heading type="h4" weight="bold" fontSize="xl" className="mb-8 leading-normal text-black">
35
+ {children}
36
+ </Heading>
37
+ ),
38
+ h6: ({ children }) => (
29
39
  <Heading type="h4" weight="bold" fontSize="lg" className="mb-8 leading-normal text-black">
30
40
  {children}
31
41
  </Heading>
@@ -1 +0,0 @@
1
- import{Heading as a}from"@stackshift-ui/heading";import{Text as i}from"@stackshift-ui/text";import{Link as r}from"@stackshift-ui/link";import{Image as n}from"@stackshift-ui/image";import{jsx as l,jsxs as s}from"react/jsx-runtime";var b={block:{h1:({children:e})=>l(a,{fontSize:"3xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h2:({children:e})=>l(a,{type:"h2",weight:"bold",fontSize:"2xl",className:"mb-8 text-black",children:e}),h3:({children:e})=>l(a,{type:"h3",fontSize:"xl",weight:"bold",className:"mb-8 leading-normal text-black",children:e}),h4:({children:e})=>l(a,{type:"h4",weight:"bold",fontSize:"lg",className:"mb-8 leading-normal text-black",children:e}),normal:({children:e})=>l(i,{className:"mb-8 leading-relaxed",children:e}),blockquote:({children:e})=>s("blockquote",{className:"mb-6 italic leading-loose text-gray-500 px-14",children:["- ",e]})},code:({value:e})=>l("pre",{"data-language":e.language,children:l("code",{children:e.code})}),list:{bullet:({children:e})=>l("ul",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-disc",children:e}),number:({children:e})=>l("ol",{className:"flex flex-col pl-10 mb-8 space-y-4 leading-relaxed list-decimal",children:e})},listItem:{bullet:({children:e})=>l("li",{className:"leading-relaxed",children:e}),number:({children:e})=>l("li",{className:"leading-relaxed",children:e})},marks:{strong:({children:e})=>l("strong",{children:e}),em:({children:e})=>l("em",{children:e}),code:({children:e})=>l("code",{children:e}),link:({children:e,value:t})=>l(r,{className:"hover:text-primary-foreground text-primary",href:t.href,target:"_blank",rel:"noopener noreferrer",children:e})},types:{addImage:({value:e})=>{var t,o,m;return l(n,{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:(m=e==null?void 0:e.alt)!=null?m:(o=(t=e==null?void 0:e.image)==null?void 0:t.asset)==null?void 0:o._ref})}}};export{b as a};
@@ -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};