@tatamicks/text 0.1.5 → 0.1.6

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/index.css CHANGED
@@ -1 +1 @@
1
- [contenteditable][data-placeholder]:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none;position:absolute}[contenteditable=false]{cursor:default}._ghost_tf9uv_15{visibility:hidden;position:absolute;pointer-events:none}@media print{._ghost_tf9uv_15{display:none}}
1
+ [contenteditable][data-placeholder]:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none;position:absolute}[contenteditable=false]{cursor:default}._ghost_1spb5_29{visibility:hidden;position:absolute;pointer-events:none}@media print{._ghost_1spb5_29{display:none}}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("@tatamicks/core"),f=require("react");var W={exports:{}},C={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const o=require("@tatamicks/core"),d=require("react");var W={exports:{}},j={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var K;function oe(){if(K)return C;K=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function h(m,u,d){var g=null;if(d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),"key"in u){d={};for(var x in u)x!=="key"&&(d[x]=u[x])}else d=u;return u=d.ref,{$$typeof:t,type:m,key:g,ref:u!==void 0?u:null,props:d}}return C.Fragment=s,C.jsx=h,C.jsxs=h,C}var I={};/**
9
+ */var K;function oe(){if(K)return j;K=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function x(m,u,f){var R=null;if(f!==void 0&&(R=""+f),u.key!==void 0&&(R=""+u.key),"key"in u){f={};for(var g in u)g!=="key"&&(f[g]=u[g])}else f=u;return u=f.ref,{$$typeof:t,type:m,key:R,ref:u!==void 0?u:null,props:f}}return j.Fragment=s,j.jsx=x,j.jsxs=x,j}var N={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,10 +14,10 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ee;function ae(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case Y:return"Profiler";case z:return"StrictMode";case r:return"Suspense";case c:return"SuspenseList";case b:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case v:return"Portal";case H:return e.displayName||"Context";case y:return(e._context.displayName||"Context")+".Consumer";case M:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case p:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function s(e){return""+e}function h(e){try{s(e);var n=!1}catch{n=!0}if(n){n=console;var o=n.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),s(e)}}function m(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===p)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function u(){var e=N.A;return e===null?null:e.getOwner()}function d(){return Error("react-stack-top-frame")}function g(e){if(S.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function x(e,n){function o(){T||(T=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}function D(){var e=t(this.type);return G[e]||(G[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function $(e,n,o,i,L,q){var l=o.ref;return e={$$typeof:O,type:e,key:n,props:o,_owner:i},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:D}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function P(e,n,o,i,L,q){var l=n.children;if(l!==void 0)if(i)if(U(l)){for(i=0;i<l.length;i++)R(l[i]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else R(l);if(S.call(n,"key")){l=t(e);var w=Object.keys(n).filter(function(ne){return ne!=="key"});i=0<w.length?"{key: someKey, "+w.join(": ..., ")+": ...}":"{key: someKey}",Q[l+i]||(w=0<w.length?"{"+w.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ee;function ae(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===_?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case $:return"Profiler";case V:return"StrictMode";case Y:return"Suspense";case U:return"SuspenseList";case c:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case D:return"Portal";case y:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case Z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return n=e.displayName||null,n!==null?n:t(e.type)||"Memo";case r:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function s(e){return""+e}function x(e){try{s(e);var n=!1}catch{n=!0}if(n){n=console;var a=n.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),s(e)}}function m(e){if(e===h)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===r)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function u(){var e=E.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function R(e){if(b.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function g(e,n){function a(){S||(S=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function H(){var e=t(this.type);return M[e]||(M[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function I(e,n,a,i,L,B){var l=a.ref;return e={$$typeof:F,type:e,key:n,props:a,_owner:i},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:H}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,n,a,i,L,B){var l=n.children;if(l!==void 0)if(i)if(J(l)){for(i=0;i<l.length;i++)P(l[i]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else P(l);if(b.call(n,"key")){l=t(e);var k=Object.keys(n).filter(function(ne){return ne!=="key"});i=0<k.length?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}",Q[l+i]||(k=0<k.length?"{"+k.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,i,l,w,l),Q[l+i]=!0)}if(l=null,o!==void 0&&(h(o),l=""+o),g(n)&&(h(n.key),l=""+n.key),"key"in n){o={};for(var J in n)J!=="key"&&(o[J]=n[J])}else o=n;return l&&x(o,typeof e=="function"?e.displayName||e.name||"Unknown":e),$(e,l,o,u(),L,q)}function R(e){A(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===p&&(e._payload.status==="fulfilled"?A(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function A(e){return typeof e=="object"&&e!==null&&e.$$typeof===O}var E=f,O=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),H=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),r=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),N=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,S=Object.prototype.hasOwnProperty,U=Array.isArray,k=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(e){return e()}};var T,G={},X=E.react_stack_bottom_frame.bind(E,d)(),Z=k(m(d)),Q={};I.Fragment=j,I.jsx=function(e,n,o){var i=1e4>N.recentlyCreatedOwnerStacks++;return P(e,n,o,!1,i?Error("react-stack-top-frame"):X,i?k(m(e)):Z)},I.jsxs=function(e,n,o){var i=1e4>N.recentlyCreatedOwnerStacks++;return P(e,n,o,!0,i?Error("react-stack-top-frame"):X,i?k(m(e)):Z)}})()),I}var te;function ie(){return te||(te=1,process.env.NODE_ENV==="production"?W.exports=oe():W.exports=ae()),W.exports}var F=ie();const le="_ghost_tf9uv_15",se={ghost:le},B=f.forwardRef(({props:t,value:s,onChange:h,onBlur:m,readOnly:u},d)=>{const g=f.useRef(null),x=f.useRef(null),D=f.useRef(null),$=f.useRef(null),[P,R]=f.useState({top:0,bottom:0}),[A,E]=f.useState(null);f.useEffect(()=>{if(!t.multiline)return;const r=$.current,c=D.current;if(!r||!c)return;r.value=s??"";const _=window.getComputedStyle(c),p=Number.parseFloat(_.paddingTop),b=Number.parseFloat(_.paddingBottom),V=Number.parseFloat(_.paddingLeft),N=Number.parseFloat(_.paddingRight),S=c.clientHeight-p-b,U=c.clientWidth-V-N;r.style.width=`${U}px`,r.style.paddingTop="0px",r.style.paddingBottom="0px";const k=r.scrollHeight;if(E(S),k<S){const T=S-k;switch(t.alignItems){case a.VerticalAlign.top:R({top:0,bottom:T});break;case a.VerticalAlign.bottom:R({top:T,bottom:0});break;default:R({top:T/2,bottom:T/2});break}}else R({top:0,bottom:0})},[t,s]),f.useImperativeHandle(d,()=>({focus:()=>{var r;(r=g.current)==null||r.focus()}}),[]);const O=f.useMemo(()=>{const r={width:"100%",height:"100%",display:"flex",boxSizing:"border-box",overflow:"hidden"};switch(t.justifyContent){case a.HorizontalAlign.center:r.justifyContent="center";break;case a.HorizontalAlign.right:r.justifyContent="flex-end";break;default:r.justifyContent="flex-start";break}switch(t.alignItems){case a.VerticalAlign.top:r.alignItems="flex-start";break;case a.VerticalAlign.bottom:r.alignItems="flex-end";break;default:r.alignItems="center";break}if(t.isIndividual)t.top&&(r.paddingTop=a.toPx.fromDim(t.top)),t.right&&(r.paddingRight=a.toPx.fromDim(t.right)),t.bottom&&(r.paddingBottom=a.toPx.fromDim(t.bottom)),t.left&&(r.paddingLeft=a.toPx.fromDim(t.left));else if(t.all){const c=a.toPx.fromDim(t.all);r.padding=`${c}px`}return r},[t]),v=f.useMemo(()=>{const r={background:"transparent",border:"none",outline:"none",resize:"none",padding:0,margin:0,width:"100%",boxSizing:"border-box",fontFamily:"inherit",color:"inherit"};t.fontSize&&(r.fontSize=`${a.toPx.fromDim(t.fontSize)}px`),t.fontFamily&&(r.fontFamily=t.fontFamily),t.color&&(r.color=t.color),r.fontWeight=t.fontWeight?"bold":"normal",r.fontStyle=t.italic?"italic":"normal";const c=[];switch(t.underline&&c.push("underline"),t.lineThrough&&c.push("line-through"),r.textDecoration=c.length>0?c.join(" "):"none",t.lineHeight&&(r.lineHeight=t.lineHeight),t.justifyContent){case a.HorizontalAlign.center:r.textAlign="center";break;case a.HorizontalAlign.right:r.textAlign="right";break;default:r.textAlign="left";break}return r},[t]),j=f.useMemo(()=>({...v,position:"absolute",top:0,left:0,width:"100%",height:"auto",visibility:"hidden",pointerEvents:"none",overflow:"hidden",whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",padding:0,border:"none",boxSizing:"border-box",resize:"none"}),[v]),z=r=>{h(r.target.value)},Y=()=>{m==null||m(s)},y=!u;if(t.multiline){const r={...v,resize:"none",overflow:"auto",height:A!==null?`${A}px`:"100%",paddingTop:`${P.top}px`,paddingBottom:`${P.bottom}px`},p={ref:b=>{x.current=b,g.current=b},value:s??"",onChange:b=>{z(b)},onBlur:Y,style:r,placeholder:t.placeholder,readOnly:!y,tabIndex:y?0:-1};return F.jsxs("div",{ref:D,style:O,children:[F.jsx("textarea",{ref:$,className:se.ghost,style:j,"aria-hidden":"true",readOnly:!0,tabIndex:-1,rows:1,value:s??""}),F.jsx("textarea",{...p})]})}const H={...v,height:"100%"},M={ref:g,value:s??"",onChange:z,onBlur:Y,style:H,placeholder:t.placeholder,readOnly:!y,tabIndex:y?0:-1};return F.jsx("div",{style:O,children:F.jsx("input",{type:"text",...M})})});B.displayName="TextRenderer";function re(t=a.DEFAULT_FONT_FAMILY){return{kind:"text",meta:{displayName:"テキスト",description:"リッチなテキスト編集ブロック",defaultSize:{w:4,h:2}},Renderer:B,properties:{...a.universalProperties,...a.placeholderDefinition,...a.fontStyleDefinition,...a.multilineDefinition,...a.validationDefinition,fontFamily:{defaultValue:"sans-serif",label:"フォント",group:"フォント",Component:a.Select,config:{placeholder:"フォントを選択",options:t}}},validateProps:s=>s,validateValue:s=>typeof s=="string"?s:typeof s=="number"?String(s):null}}const ce=re();exports.TextPlugin=ce;exports.TextRenderer=B;exports.createTextPlugin=re;
22
+ <%s key={someKey} {...props} />`,i,l,k,l),Q[l+i]=!0)}if(l=null,a!==void 0&&(x(a),l=""+a),R(n)&&(x(n.key),l=""+n.key),"key"in n){a={};for(var G in n)G!=="key"&&(a[G]=n[G])}else a=n;return l&&g(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),I(e,l,a,u(),L,B)}function P(e){p(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===r&&(e._payload.status==="fulfilled"?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e=="object"&&e!==null&&e.$$typeof===F}var T=d,F=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),y=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),r=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),_=Symbol.for("react.client.reference"),E=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,b=Object.prototype.hasOwnProperty,J=Array.isArray,A=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var S,M={},O=T.react_stack_bottom_frame.bind(T,f)(),v=A(m(f)),Q={};N.Fragment=h,N.jsx=function(e,n,a){var i=1e4>E.recentlyCreatedOwnerStacks++;return w(e,n,a,!1,i?Error("react-stack-top-frame"):O,i?A(m(e)):v)},N.jsxs=function(e,n,a){var i=1e4>E.recentlyCreatedOwnerStacks++;return w(e,n,a,!0,i?Error("react-stack-top-frame"):O,i?A(m(e)):v)}})()),N}var te;function ie(){return te||(te=1,process.env.NODE_ENV==="production"?W.exports=oe():W.exports=ae()),W.exports}var C=ie();const le="_ghost_1spb5_29",se={ghost:le},X=d.forwardRef(({props:t,value:s,onChange:x,onBlur:m,readOnly:u,mode:f},R)=>{const g=d.useRef(null),H=d.useRef(null),I=d.useRef(null),w=d.useRef(null),[P,p]=d.useState({top:0,bottom:0}),[T,F]=d.useState(null);d.useEffect(()=>{if(!t.multiline)return;const r=w.current,c=I.current;if(!r||!c)return;r.value=s??"";const _=window.getComputedStyle(c),E=Number.parseFloat(_.paddingTop),b=Number.parseFloat(_.paddingBottom),J=Number.parseFloat(_.paddingLeft),A=Number.parseFloat(_.paddingRight),S=c.clientHeight-E-b,M=c.clientWidth-J-A;r.style.width=`${M}px`,r.style.paddingTop="0px",r.style.paddingBottom="0px";const O=r.scrollHeight;if(F(S),O<S){const v=S-O;switch(t.alignItems){case o.VerticalAlign.top:p({top:0,bottom:v});break;case o.VerticalAlign.bottom:p({top:v,bottom:0});break;default:p({top:v/2,bottom:v/2});break}}else p({top:0,bottom:0})},[t,s]),d.useImperativeHandle(R,()=>({focus:()=>{var r;(r=g.current)==null||r.focus()}}),[]);const D=d.useMemo(()=>{const r={width:"100%",height:"100%",display:"flex",boxSizing:"border-box",overflow:"hidden"};switch(t.justifyContent){case o.HorizontalAlign.center:r.justifyContent="center";break;case o.HorizontalAlign.right:r.justifyContent="flex-end";break;default:r.justifyContent="flex-start";break}switch(t.alignItems){case o.VerticalAlign.top:r.alignItems="flex-start";break;case o.VerticalAlign.bottom:r.alignItems="flex-end";break;default:r.alignItems="center";break}if(t.isIndividual)t.top&&(r.paddingTop=o.toPx.fromDim(t.top)),t.right&&(r.paddingRight=o.toPx.fromDim(t.right)),t.bottom&&(r.paddingBottom=o.toPx.fromDim(t.bottom)),t.left&&(r.paddingLeft=o.toPx.fromDim(t.left));else if(t.all){const c=o.toPx.fromDim(t.all);r.padding=`${c}px`}return r},[t]),h=d.useMemo(()=>{const r={background:"transparent",border:"none",outline:"none",resize:"none",padding:0,margin:0,width:"100%",boxSizing:"border-box",fontFamily:"inherit",color:"inherit"};t.fontSize&&(r.fontSize=`${o.toPx.fromDim(t.fontSize)}px`),t.fontFamily&&(r.fontFamily=t.fontFamily),t.color&&(r.color=t.color),r.fontWeight=t.fontWeight?"bold":"normal",r.fontStyle=t.italic?"italic":"normal";const c=[];switch(t.underline&&c.push("underline"),t.lineThrough&&c.push("line-through"),r.textDecoration=c.length>0?c.join(" "):"none",t.lineHeight&&(r.lineHeight=t.lineHeight),t.justifyContent){case o.HorizontalAlign.center:r.textAlign="center";break;case o.HorizontalAlign.right:r.textAlign="right";break;default:r.textAlign="left";break}return r},[t]),V=d.useMemo(()=>({...h,position:"absolute",top:0,left:0,width:"100%",height:"auto",visibility:"hidden",pointerEvents:"none",overflow:"hidden",whiteSpace:"pre-wrap",wordWrap:"break-word",overflowWrap:"break-word",padding:0,border:"none",boxSizing:"border-box",resize:"none"}),[h]),$=r=>{x(r.target.value)},z=()=>{m==null||m(s)},y=!u,Y=f===o.NoteMode.EDIT||f===o.NoteMode.FORM?t.placeholder:void 0;if(t.multiline){const r={...h,resize:"none",overflow:"auto",height:T!==null?`${T}px`:"100%",paddingTop:`${P.top}px`,paddingBottom:`${P.bottom}px`},E={ref:b=>{H.current=b,g.current=b},value:s??"",onChange:b=>{$(b)},onBlur:z,style:r,placeholder:Y,readOnly:!y,tabIndex:y?0:-1};return C.jsxs("div",{ref:I,style:D,children:[C.jsx("textarea",{ref:w,className:se.ghost,style:V,"aria-hidden":"true",readOnly:!0,tabIndex:-1,rows:1,value:s??""}),C.jsx("textarea",{...E})]})}const U={...h,height:"100%"},q={ref:g,value:s??"",onChange:$,onBlur:z,style:U,placeholder:Y,readOnly:!y,tabIndex:y?0:-1};return C.jsx("div",{style:D,children:C.jsx("input",{type:"text",...q})})});X.displayName="TextRenderer";function re(t=o.DEFAULT_FONT_FAMILY){return{kind:"text",meta:{displayName:"テキスト",description:"リッチなテキスト編集ブロック",defaultSize:{w:4,h:2}},Renderer:X,properties:{...o.universalProperties,...o.placeholderDefinition,...o.fontStyleDefinition,...o.multilineDefinition,...o.validationDefinition,fontFamily:{defaultValue:"sans-serif",label:"フォント",group:"フォント",Component:o.Select,config:{placeholder:"フォントを選択",options:t}}},validateProps:s=>s,validateValue:s=>typeof s=="string"?s:typeof s=="number"?String(s):null}}const ce=re();exports.TextPlugin=ce;exports.TextRenderer=X;exports.createTextPlugin=re;
23
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/react/jsx-runtime.js","../src/TextRenderer.tsx","../src/TextPlugin.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import {\n\ttype CSSProperties,\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport {\n\ttype BlockRef,\n\tHorizontalAlign,\n\ttype RendererProps,\n\ttoPx,\n\tVerticalAlign,\n} from \"@tatamicks/core\";\n\nimport styles from \"./TextRenderer.module.css\";\n\nimport type { TextProps, TextValue } from \"./types\";\n\nexport const TextRenderer = forwardRef<\n\tBlockRef,\n\tRendererProps<TextProps, TextValue>\n>(({ props, value, onChange, onBlur, readOnly }, ref) => {\n\t// 入力要素への参照\n\tconst inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst ghostRef = useRef<HTMLTextAreaElement>(null);\n\n\tconst [textareaPadding, setTextareaPadding] = useState({ top: 0, bottom: 0 });\n\tconst [textareaHeight, setTextareaHeight] = useState<number | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!props.multiline) return;\n\n\t\tconst ghost = ghostRef.current;\n\t\tconst container = containerRef.current;\n\t\tif (!ghost || !container) return;\n\n\t\tghost.value = value ?? \"\";\n\n\t\tconst containerStyle = window.getComputedStyle(container);\n\t\tconst paddingTop = Number.parseFloat(containerStyle.paddingTop);\n\t\tconst paddingBottom = Number.parseFloat(containerStyle.paddingBottom);\n\t\tconst paddingLeft = Number.parseFloat(containerStyle.paddingLeft);\n\t\tconst paddingRight = Number.parseFloat(containerStyle.paddingRight);\n\n\t\tconst containerHeight = container.clientHeight - paddingTop - paddingBottom;\n\t\tconst availableWidth = container.clientWidth - paddingLeft - paddingRight;\n\n\t\tghost.style.width = `${availableWidth}px`;\n\t\tghost.style.paddingTop = \"0px\";\n\t\tghost.style.paddingBottom = \"0px\";\n\n\t\tconst contentHeight = ghost.scrollHeight;\n\n\t\tsetTextareaHeight(containerHeight);\n\n\t\tif (contentHeight < containerHeight) {\n\t\t\tconst availableSpace = containerHeight - contentHeight;\n\n\t\t\tswitch (props.alignItems) {\n\t\t\t\tcase VerticalAlign.top:\n\t\t\t\t\tsetTextareaPadding({ top: 0, bottom: availableSpace });\n\t\t\t\t\tbreak;\n\t\t\t\tcase VerticalAlign.bottom:\n\t\t\t\t\tsetTextareaPadding({ top: availableSpace, bottom: 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsetTextareaPadding({\n\t\t\t\t\t\ttop: availableSpace / 2,\n\t\t\t\t\t\tbottom: availableSpace / 2,\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tsetTextareaPadding({ top: 0, bottom: 0 });\n\t\t}\n\t}, [props, value]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t},\n\t\t}),\n\t\t[],\n\t);\n\n\tconst containerStyle = useMemo((): CSSProperties => {\n\t\tconst css: CSSProperties = {\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100%\",\n\t\t\tdisplay: \"flex\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\toverflow: \"hidden\",\n\t\t};\n\n\t\tswitch (props.justifyContent) {\n\t\t\tcase HorizontalAlign.center:\n\t\t\t\tcss.justifyContent = \"center\";\n\t\t\t\tbreak;\n\t\t\tcase HorizontalAlign.right:\n\t\t\t\tcss.justifyContent = \"flex-end\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcss.justifyContent = \"flex-start\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tswitch (props.alignItems) {\n\t\t\tcase VerticalAlign.top:\n\t\t\t\tcss.alignItems = \"flex-start\";\n\t\t\t\tbreak;\n\t\t\tcase VerticalAlign.bottom:\n\t\t\t\tcss.alignItems = \"flex-end\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcss.alignItems = \"center\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (props.isIndividual) {\n\t\t\tif (props.top) css.paddingTop = toPx.fromDim(props.top);\n\t\t\tif (props.right) css.paddingRight = toPx.fromDim(props.right);\n\t\t\tif (props.bottom) css.paddingBottom = toPx.fromDim(props.bottom);\n\t\t\tif (props.left) css.paddingLeft = toPx.fromDim(props.left);\n\t\t} else if (props.all) {\n\t\t\tconst p = toPx.fromDim(props.all);\n\t\t\tcss.padding = `${p}px`;\n\t\t}\n\n\t\treturn css;\n\t}, [props]);\n\n\tconst inputStyle = useMemo((): CSSProperties => {\n\t\tconst css: CSSProperties = {\n\t\t\tbackground: \"transparent\",\n\t\t\tborder: \"none\",\n\t\t\toutline: \"none\",\n\t\t\tresize: \"none\",\n\t\t\tpadding: 0,\n\t\t\tmargin: 0,\n\t\t\twidth: \"100%\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tfontFamily: \"inherit\",\n\t\t\tcolor: \"inherit\",\n\t\t};\n\n\t\tif (props.fontSize) {\n\t\t\tcss.fontSize = `${toPx.fromDim(props.fontSize)}px`;\n\t\t}\n\n\t\tif (props.fontFamily) css.fontFamily = props.fontFamily;\n\t\tif (props.color) css.color = props.color;\n\n\t\tcss.fontWeight = props.fontWeight ? \"bold\" : \"normal\";\n\t\tcss.fontStyle = props.italic ? \"italic\" : \"normal\";\n\n\t\tconst decorations: string[] = [];\n\t\tif (props.underline) decorations.push(\"underline\");\n\t\tif (props.lineThrough) decorations.push(\"line-through\");\n\t\tcss.textDecoration =\n\t\t\tdecorations.length > 0 ? decorations.join(\" \") : \"none\";\n\n\t\tif (props.lineHeight) css.lineHeight = props.lineHeight;\n\n\t\tswitch (props.justifyContent) {\n\t\t\tcase HorizontalAlign.center:\n\t\t\t\tcss.textAlign = \"center\";\n\t\t\t\tbreak;\n\t\t\tcase HorizontalAlign.right:\n\t\t\t\tcss.textAlign = \"right\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcss.textAlign = \"left\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn css;\n\t}, [props]);\n\n\tconst ghostStyle = useMemo((): CSSProperties => {\n\t\treturn {\n\t\t\t...inputStyle,\n\t\t\tposition: \"absolute\",\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: \"100%\",\n\t\t\theight: \"auto\",\n\t\t\tvisibility: \"hidden\",\n\t\t\tpointerEvents: \"none\",\n\t\t\toverflow: \"hidden\",\n\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\twordWrap: \"break-word\",\n\t\t\toverflowWrap: \"break-word\",\n\t\t\tpadding: 0,\n\t\t\tborder: \"none\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tresize: \"none\",\n\t\t};\n\t}, [inputStyle]);\n\n\tconst handleChange = (\n\t\te: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n\t) => {\n\t\tonChange(e.target.value);\n\t};\n\n\tconst handleBlur = () => {\n\t\tonBlur?.(value);\n\t};\n\n\tconst isEditable = !readOnly;\n\n\tif (props.multiline) {\n\t\tconst textareaStyle: CSSProperties = {\n\t\t\t...inputStyle,\n\t\t\tresize: \"none\",\n\t\t\toverflow: \"auto\",\n\t\t\theight: textareaHeight !== null ? `${textareaHeight}px` : \"100%\",\n\t\t\tpaddingTop: `${textareaPadding.top}px`,\n\t\t\tpaddingBottom: `${textareaPadding.bottom}px`,\n\t\t};\n\n\t\tconst handleTextareaChange = (\n\t\t\te: React.ChangeEvent<HTMLTextAreaElement>,\n\t\t) => {\n\t\t\thandleChange(e);\n\t\t};\n\n\t\tconst setTextareaRefs = (el: HTMLTextAreaElement | null) => {\n\t\t\ttextareaRef.current = el;\n\t\t\tinputRef.current = el;\n\t\t};\n\n\t\tconst textareaProps = {\n\t\t\tref: setTextareaRefs,\n\t\t\tvalue: value ?? \"\",\n\t\t\tonChange: handleTextareaChange,\n\t\t\tonBlur: handleBlur,\n\t\t\tstyle: textareaStyle,\n\t\t\tplaceholder: props.placeholder,\n\t\t\treadOnly: !isEditable,\n\t\t\ttabIndex: isEditable ? 0 : -1,\n\t\t};\n\n\t\treturn (\n\t\t\t<div ref={containerRef} style={containerStyle}>\n\t\t\t\t<textarea\n\t\t\t\t\tref={ghostRef}\n\t\t\t\t\tclassName={styles.ghost}\n\t\t\t\t\tstyle={ghostStyle}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\treadOnly\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\trows={1}\n\t\t\t\t\tvalue={value ?? \"\"}\n\t\t\t\t/>\n\t\t\t\t<textarea {...textareaProps} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst singleLineStyle: CSSProperties = {\n\t\t...inputStyle,\n\t\theight: \"100%\",\n\t};\n\n\tconst commonInputProps = {\n\t\tref: inputRef as React.RefObject<HTMLInputElement>,\n\t\tvalue: value ?? \"\",\n\t\tonChange: handleChange,\n\t\tonBlur: handleBlur,\n\t\tstyle: singleLineStyle,\n\t\tplaceholder: props.placeholder,\n\t\treadOnly: !isEditable,\n\t\ttabIndex: isEditable ? 0 : -1,\n\t};\n\n\treturn (\n\t\t<div style={containerStyle}>\n\t\t\t<input type=\"text\" {...commonInputProps} />\n\t\t</div>\n\t);\n});\n\nTextRenderer.displayName = \"TextRenderer\";\n","import {\n\ttype BlockPlugin,\n\tDEFAULT_FONT_FAMILY,\n\tfontStyleDefinition,\n\tmultilineDefinition,\n\tplaceholderDefinition,\n\tSelect,\n\ttype SelectOption,\n\tuniversalProperties,\n\tvalidationDefinition,\n} from \"@tatamicks/core\";\n\nimport { TextRenderer } from \"./TextRenderer\";\n\nimport type { TextProps, TextValue } from \"./types\";\n\nexport function createTextPlugin(\n\tfontFamilyOptions: readonly SelectOption[] = DEFAULT_FONT_FAMILY,\n): BlockPlugin<TextProps, TextValue> {\n\treturn {\n\t\tkind: \"text\",\n\n\t\tmeta: {\n\t\t\tdisplayName: \"テキスト\",\n\t\t\tdescription: \"リッチなテキスト編集ブロック\",\n\t\t\tdefaultSize: { w: 4, h: 2 }, // デフォルトサイズ\n\t\t},\n\n\t\tRenderer: TextRenderer,\n\n\t\tproperties: {\n\t\t\t...universalProperties,\n\t\t\t...placeholderDefinition,\n\t\t\t...fontStyleDefinition,\n\t\t\t...multilineDefinition,\n\t\t\t...validationDefinition,\n\n\t\t\tfontFamily: {\n\t\t\t\tdefaultValue: \"sans-serif\",\n\t\t\t\tlabel: \"フォント\",\n\t\t\t\tgroup: \"フォント\",\n\t\t\t\tComponent: Select,\n\t\t\t\tconfig: {\n\t\t\t\t\tplaceholder: \"フォントを選択\",\n\t\t\t\t\toptions: fontFamilyOptions,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t// バリデーション (Propsの型チェックと初期化)\n\t\tvalidateProps: (props: unknown): TextProps => {\n\t\t\t// createInitialPropsを通すので、基本的にはキャストでOKですが、\n\t\t\t// 必要に応じて厳密なチェックを行います\n\t\t\treturn props as TextProps;\n\t\t},\n\n\t\t// 値のバリデーション\n\t\tvalidateValue: (value: unknown): TextValue | null => {\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\") return String(value);\n\t\t\treturn null;\n\t\t},\n\t};\n}\n\nexport const TextPlugin: BlockPlugin<TextProps, TextValue> = createTextPlugin();\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","TextRenderer","forwardRef","onChange","onBlur","readOnly","ref","inputRef","useRef","textareaRef","containerRef","ghostRef","textareaPadding","setTextareaPadding","useState","textareaHeight","setTextareaHeight","useEffect","ghost","container","containerStyle","paddingTop","paddingBottom","paddingLeft","paddingRight","containerHeight","availableWidth","contentHeight","availableSpace","VerticalAlign","useImperativeHandle","_a","useMemo","css","HorizontalAlign","toPx","p","inputStyle","decorations","ghostStyle","handleChange","e","handleBlur","isEditable","textareaStyle","textareaProps","el","jsxs","jsx","styles","singleLineStyle","commonInputProps","createTextPlugin","fontFamilyOptions","DEFAULT_FONT_FAMILY","universalProperties","placeholderDefinition","fontStyleDefinition","multilineDefinition","validationDefinition","Select","TextPlugin"],"mappings":";;;;;;;;yCAWA,IAAIA,EAAqB,OAAO,IAAI,4BAA4B,EAC9DC,EAAsB,OAAO,IAAI,gBAAgB,EACnD,SAASC,EAAQC,EAAMC,EAAQC,EAAU,CACvC,IAAIC,EAAM,KAGV,GAFWD,IAAX,SAAwBC,EAAM,GAAKD,GACxBD,EAAO,MAAlB,SAA0BE,EAAM,GAAKF,EAAO,KACxC,QAASA,EAAQ,CACnBC,EAAW,CAAA,EACX,QAASE,KAAYH,EACTG,IAAV,QAAuBF,EAASE,CAAQ,EAAIH,EAAOG,CAAQ,EACjE,MAASF,EAAWD,EAClB,OAAAA,EAASC,EAAS,IACX,CACL,SAAUL,EACV,KAAMG,EACN,IAAKG,EACL,IAAgBF,IAAX,OAAoBA,EAAS,KAClC,MAAOC,EAEX,CACA,OAAAG,EAAA,SAAmBP,EACnBO,EAAA,IAAcN,EACdM,EAAA,KAAeN;;;;;;;;yCCtBE,QAAQ,IAAI,WAA7B,eACG,UAAY,CACX,SAASO,EAAyBN,EAAM,CACtC,GAAYA,GAAR,KAAc,OAAO,KACzB,GAAmB,OAAOA,GAAtB,WACF,OAAOA,EAAK,WAAaO,EACrB,KACAP,EAAK,aAAeA,EAAK,MAAQ,KACvC,GAAiB,OAAOA,GAApB,SAA0B,OAAOA,EACrC,OAAQA,EAAI,CACV,KAAKF,EACH,MAAO,WACT,KAAKU,EACH,MAAO,WACT,KAAKC,EACH,MAAO,aACT,KAAKC,EACH,MAAO,WACT,KAAKC,EACH,MAAO,eACT,KAAKC,EACH,MAAO,UACjB,CACM,GAAiB,OAAOZ,GAApB,SACF,OACgB,OAAOA,EAAK,KAAzB,UACC,QAAQ,MACN,qHAEJA,EAAK,SACf,CACU,KAAKa,EACH,MAAO,SACT,KAAKC,EACH,OAAOd,EAAK,aAAe,UAC7B,KAAKe,EACH,OAAQf,EAAK,SAAS,aAAe,WAAa,YACpD,KAAKgB,EACH,I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C9B,SAAA,CAAA4B,EAAAA,IAAC,WAAA,CACA,IAAKrC,EACL,UAAWsC,GAAO,MAClB,MAAOV,EACP,cAAY,OACZ,SAAQ,GACR,SAAU,GACV,KAAM,EACN,MAAOtF,GAAS,EAAA,CAAA,EAEjB+F,MAAC,WAAA,CAAU,GAAGH,CAAA,CAAe,CAAA,EAC9B,CAEF,CAEA,MAAMK,EAAiC,CACtC,GAAGb,EACH,OAAQ,MAAA,EAGHc,EAAmB,CACxB,IAAK5C,EACL,MAAOtD,GAAS,GAChB,SAAUuF,EACV,OAAQE,EACR,MAAOQ,EACP,YAAalF,EAAM,YACnB,SAAU,CAAC2E,EACX,SAAUA,EAAa,EAAI,EAAA,EAG5B,OACCK,EAAAA,IAAC,MAAA,CAAI,MAAO5B,EACX,SAAA4B,EAAAA,IAAC,SAAM,KAAK,OAAQ,GAAGG,CAAA,CAAkB,CAAA,CAC1C,CAEF,CAAC,EAEDlD,EAAa,YAAc,eClRpB,SAASmD,GACfC,EAA6CC,sBACT,CACpC,MAAO,CACN,KAAM,OAEN,KAAM,CACL,YAAa,OACb,YAAa,iBACb,YAAa,CAAE,EAAG,EAAG,EAAG,CAAA,CAAE,EAG3B,SAAUrD,EAEV,WAAY,CACX,GAAGsD,EAAAA,oBACH,GAAGC,EAAAA,sBACH,GAAGC,EAAAA,oBACH,GAAGC,EAAAA,oBACH,GAAGC,EAAAA,qBAEH,WAAY,CACX,aAAc,aACd,MAAO,OACP,MAAO,OACP,UAAWC,EAAAA,OACX,OAAQ,CACP,YAAa,UACb,QAASP,CAAA,CACV,CACD,EAID,cAAgBrF,GAGRA,EAIR,cAAgBf,GACX,OAAOA,GAAU,SAAiBA,EAClC,OAAOA,GAAU,SAAiB,OAAOA,CAAK,EAC3C,IACR,CAEF,CAEO,MAAM4G,GAAgDT,GAAA","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/react/jsx-runtime.js","../src/TextRenderer.tsx","../src/TextPlugin.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import {\r\n\ttype CSSProperties,\r\n\tforwardRef,\r\n\tuseEffect,\r\n\tuseImperativeHandle,\r\n\tuseMemo,\r\n\tuseRef,\r\n\tuseState,\r\n} from \"react\";\r\nimport {\r\n\ttype BlockRef,\r\n\tHorizontalAlign,\r\n\tNoteMode,\r\n\ttype RendererProps,\r\n\ttoPx,\r\n\tVerticalAlign,\r\n} from \"@tatamicks/core\";\r\n\r\nimport styles from \"./TextRenderer.module.css\";\r\n\r\nimport type { TextProps, TextValue } from \"./types\";\r\n\r\nexport const TextRenderer = forwardRef<\r\n\tBlockRef,\r\n\tRendererProps<TextProps, TextValue>\r\n>(({ props, value, onChange, onBlur, readOnly, mode }, ref) => {\r\n\t// 入力要素への参照\r\n\tconst inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\r\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\r\n\tconst containerRef = useRef<HTMLDivElement>(null);\r\n\tconst ghostRef = useRef<HTMLTextAreaElement>(null);\r\n\r\n\tconst [textareaPadding, setTextareaPadding] = useState({ top: 0, bottom: 0 });\r\n\tconst [textareaHeight, setTextareaHeight] = useState<number | null>(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!props.multiline) return;\r\n\r\n\t\tconst ghost = ghostRef.current;\r\n\t\tconst container = containerRef.current;\r\n\t\tif (!ghost || !container) return;\r\n\r\n\t\tghost.value = value ?? \"\";\r\n\r\n\t\tconst containerStyle = window.getComputedStyle(container);\r\n\t\tconst paddingTop = Number.parseFloat(containerStyle.paddingTop);\r\n\t\tconst paddingBottom = Number.parseFloat(containerStyle.paddingBottom);\r\n\t\tconst paddingLeft = Number.parseFloat(containerStyle.paddingLeft);\r\n\t\tconst paddingRight = Number.parseFloat(containerStyle.paddingRight);\r\n\r\n\t\tconst containerHeight = container.clientHeight - paddingTop - paddingBottom;\r\n\t\tconst availableWidth = container.clientWidth - paddingLeft - paddingRight;\r\n\r\n\t\tghost.style.width = `${availableWidth}px`;\r\n\t\tghost.style.paddingTop = \"0px\";\r\n\t\tghost.style.paddingBottom = \"0px\";\r\n\r\n\t\tconst contentHeight = ghost.scrollHeight;\r\n\r\n\t\tsetTextareaHeight(containerHeight);\r\n\r\n\t\tif (contentHeight < containerHeight) {\r\n\t\t\tconst availableSpace = containerHeight - contentHeight;\r\n\r\n\t\t\tswitch (props.alignItems) {\r\n\t\t\t\tcase VerticalAlign.top:\r\n\t\t\t\t\tsetTextareaPadding({ top: 0, bottom: availableSpace });\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase VerticalAlign.bottom:\r\n\t\t\t\t\tsetTextareaPadding({ top: availableSpace, bottom: 0 });\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsetTextareaPadding({\r\n\t\t\t\t\t\ttop: availableSpace / 2,\r\n\t\t\t\t\t\tbottom: availableSpace / 2,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tsetTextareaPadding({ top: 0, bottom: 0 });\r\n\t\t}\r\n\t}, [props, value]);\r\n\r\n\tuseImperativeHandle(\r\n\t\tref,\r\n\t\t() => ({\r\n\t\t\tfocus: () => {\r\n\t\t\t\tinputRef.current?.focus();\r\n\t\t\t},\r\n\t\t}),\r\n\t\t[],\r\n\t);\r\n\r\n\tconst containerStyle = useMemo((): CSSProperties => {\r\n\t\tconst css: CSSProperties = {\r\n\t\t\twidth: \"100%\",\r\n\t\t\theight: \"100%\",\r\n\t\t\tdisplay: \"flex\",\r\n\t\t\tboxSizing: \"border-box\",\r\n\t\t\toverflow: \"hidden\",\r\n\t\t};\r\n\r\n\t\tswitch (props.justifyContent) {\r\n\t\t\tcase HorizontalAlign.center:\r\n\t\t\t\tcss.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase HorizontalAlign.right:\r\n\t\t\t\tcss.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcss.justifyContent = \"flex-start\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tswitch (props.alignItems) {\r\n\t\t\tcase VerticalAlign.top:\r\n\t\t\t\tcss.alignItems = \"flex-start\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase VerticalAlign.bottom:\r\n\t\t\t\tcss.alignItems = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcss.alignItems = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif (props.isIndividual) {\r\n\t\t\tif (props.top) css.paddingTop = toPx.fromDim(props.top);\r\n\t\t\tif (props.right) css.paddingRight = toPx.fromDim(props.right);\r\n\t\t\tif (props.bottom) css.paddingBottom = toPx.fromDim(props.bottom);\r\n\t\t\tif (props.left) css.paddingLeft = toPx.fromDim(props.left);\r\n\t\t} else if (props.all) {\r\n\t\t\tconst p = toPx.fromDim(props.all);\r\n\t\t\tcss.padding = `${p}px`;\r\n\t\t}\r\n\r\n\t\treturn css;\r\n\t}, [props]);\r\n\r\n\tconst inputStyle = useMemo((): CSSProperties => {\r\n\t\tconst css: CSSProperties = {\r\n\t\t\tbackground: \"transparent\",\r\n\t\t\tborder: \"none\",\r\n\t\t\toutline: \"none\",\r\n\t\t\tresize: \"none\",\r\n\t\t\tpadding: 0,\r\n\t\t\tmargin: 0,\r\n\t\t\twidth: \"100%\",\r\n\t\t\tboxSizing: \"border-box\",\r\n\t\t\tfontFamily: \"inherit\",\r\n\t\t\tcolor: \"inherit\",\r\n\t\t};\r\n\r\n\t\tif (props.fontSize) {\r\n\t\t\tcss.fontSize = `${toPx.fromDim(props.fontSize)}px`;\r\n\t\t}\r\n\r\n\t\tif (props.fontFamily) css.fontFamily = props.fontFamily;\r\n\t\tif (props.color) css.color = props.color;\r\n\r\n\t\tcss.fontWeight = props.fontWeight ? \"bold\" : \"normal\";\r\n\t\tcss.fontStyle = props.italic ? \"italic\" : \"normal\";\r\n\r\n\t\tconst decorations: string[] = [];\r\n\t\tif (props.underline) decorations.push(\"underline\");\r\n\t\tif (props.lineThrough) decorations.push(\"line-through\");\r\n\t\tcss.textDecoration =\r\n\t\t\tdecorations.length > 0 ? decorations.join(\" \") : \"none\";\r\n\r\n\t\tif (props.lineHeight) css.lineHeight = props.lineHeight;\r\n\r\n\t\tswitch (props.justifyContent) {\r\n\t\t\tcase HorizontalAlign.center:\r\n\t\t\t\tcss.textAlign = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase HorizontalAlign.right:\r\n\t\t\t\tcss.textAlign = \"right\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcss.textAlign = \"left\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn css;\r\n\t}, [props]);\r\n\r\n\tconst ghostStyle = useMemo((): CSSProperties => {\r\n\t\treturn {\r\n\t\t\t...inputStyle,\r\n\t\t\tposition: \"absolute\",\r\n\t\t\ttop: 0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: \"100%\",\r\n\t\t\theight: \"auto\",\r\n\t\t\tvisibility: \"hidden\",\r\n\t\t\tpointerEvents: \"none\",\r\n\t\t\toverflow: \"hidden\",\r\n\t\t\twhiteSpace: \"pre-wrap\",\r\n\t\t\twordWrap: \"break-word\",\r\n\t\t\toverflowWrap: \"break-word\",\r\n\t\t\tpadding: 0,\r\n\t\t\tborder: \"none\",\r\n\t\t\tboxSizing: \"border-box\",\r\n\t\t\tresize: \"none\",\r\n\t\t};\r\n\t}, [inputStyle]);\r\n\r\n\tconst handleChange = (\r\n\t\te: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\r\n\t) => {\r\n\t\tonChange(e.target.value);\r\n\t};\r\n\r\n\tconst handleBlur = () => {\r\n\t\tonBlur?.(value);\r\n\t};\r\n\r\n\tconst isEditable = !readOnly;\r\n\r\n\t// プレースホルダーはEDIT/FORMモードでのみ表示\r\n\tconst shouldShowPlaceholder =\r\n\t\tmode === NoteMode.EDIT || mode === NoteMode.FORM;\r\n\tconst placeholder = shouldShowPlaceholder ? props.placeholder : undefined;\r\n\r\n\tif (props.multiline) {\r\n\t\tconst textareaStyle: CSSProperties = {\r\n\t\t\t...inputStyle,\r\n\t\t\tresize: \"none\",\r\n\t\t\toverflow: \"auto\",\r\n\t\t\theight: textareaHeight !== null ? `${textareaHeight}px` : \"100%\",\r\n\t\t\tpaddingTop: `${textareaPadding.top}px`,\r\n\t\t\tpaddingBottom: `${textareaPadding.bottom}px`,\r\n\t\t};\r\n\r\n\t\tconst handleTextareaChange = (\r\n\t\t\te: React.ChangeEvent<HTMLTextAreaElement>,\r\n\t\t) => {\r\n\t\t\thandleChange(e);\r\n\t\t};\r\n\r\n\t\tconst setTextareaRefs = (el: HTMLTextAreaElement | null) => {\r\n\t\t\ttextareaRef.current = el;\r\n\t\t\tinputRef.current = el;\r\n\t\t};\r\n\r\n\t\tconst textareaProps = {\r\n\t\t\tref: setTextareaRefs,\r\n\t\t\tvalue: value ?? \"\",\r\n\t\t\tonChange: handleTextareaChange,\r\n\t\t\tonBlur: handleBlur,\r\n\t\t\tstyle: textareaStyle,\r\n\t\t\tplaceholder: placeholder,\r\n\t\t\treadOnly: !isEditable,\r\n\t\t\ttabIndex: isEditable ? 0 : -1,\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<div ref={containerRef} style={containerStyle}>\r\n\t\t\t\t<textarea\r\n\t\t\t\t\tref={ghostRef}\r\n\t\t\t\t\tclassName={styles.ghost}\r\n\t\t\t\t\tstyle={ghostStyle}\r\n\t\t\t\t\taria-hidden=\"true\"\r\n\t\t\t\t\treadOnly\r\n\t\t\t\t\ttabIndex={-1}\r\n\t\t\t\t\trows={1}\r\n\t\t\t\t\tvalue={value ?? \"\"}\r\n\t\t\t\t/>\r\n\t\t\t\t<textarea {...textareaProps} />\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n\r\n\tconst singleLineStyle: CSSProperties = {\r\n\t\t...inputStyle,\r\n\t\theight: \"100%\",\r\n\t};\r\n\r\n\tconst commonInputProps = {\r\n\t\tref: inputRef as React.RefObject<HTMLInputElement>,\r\n\t\tvalue: value ?? \"\",\r\n\t\tonChange: handleChange,\r\n\t\tonBlur: handleBlur,\r\n\t\tstyle: singleLineStyle,\r\n\t\tplaceholder: placeholder,\r\n\t\treadOnly: !isEditable,\r\n\t\ttabIndex: isEditable ? 0 : -1,\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div style={containerStyle}>\r\n\t\t\t<input type=\"text\" {...commonInputProps} />\r\n\t\t</div>\r\n\t);\r\n});\r\n\r\nTextRenderer.displayName = \"TextRenderer\";\r\n","import {\n\ttype BlockPlugin,\n\tDEFAULT_FONT_FAMILY,\n\tfontStyleDefinition,\n\tmultilineDefinition,\n\tplaceholderDefinition,\n\tSelect,\n\ttype SelectOption,\n\tuniversalProperties,\n\tvalidationDefinition,\n} from \"@tatamicks/core\";\n\nimport { TextRenderer } from \"./TextRenderer\";\n\nimport type { TextProps, TextValue } from \"./types\";\n\nexport function createTextPlugin(\n\tfontFamilyOptions: readonly SelectOption[] = DEFAULT_FONT_FAMILY,\n): BlockPlugin<TextProps, TextValue> {\n\treturn {\n\t\tkind: \"text\",\n\n\t\tmeta: {\n\t\t\tdisplayName: \"テキスト\",\n\t\t\tdescription: \"リッチなテキスト編集ブロック\",\n\t\t\tdefaultSize: { w: 4, h: 2 }, // デフォルトサイズ\n\t\t},\n\n\t\tRenderer: TextRenderer,\n\n\t\tproperties: {\n\t\t\t...universalProperties,\n\t\t\t...placeholderDefinition,\n\t\t\t...fontStyleDefinition,\n\t\t\t...multilineDefinition,\n\t\t\t...validationDefinition,\n\n\t\t\tfontFamily: {\n\t\t\t\tdefaultValue: \"sans-serif\",\n\t\t\t\tlabel: \"フォント\",\n\t\t\t\tgroup: \"フォント\",\n\t\t\t\tComponent: Select,\n\t\t\t\tconfig: {\n\t\t\t\t\tplaceholder: \"フォントを選択\",\n\t\t\t\t\toptions: fontFamilyOptions,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t// バリデーション (Propsの型チェックと初期化)\n\t\tvalidateProps: (props: unknown): TextProps => {\n\t\t\t// createInitialPropsを通すので、基本的にはキャストでOKですが、\n\t\t\t// 必要に応じて厳密なチェックを行います\n\t\t\treturn props as TextProps;\n\t\t},\n\n\t\t// 値のバリデーション\n\t\tvalidateValue: (value: unknown): TextValue | null => {\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\") return String(value);\n\t\t\treturn null;\n\t\t},\n\t};\n}\n\nexport const TextPlugin: BlockPlugin<TextProps, TextValue> = createTextPlugin();\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","TextRenderer","forwardRef","onChange","onBlur","readOnly","mode","ref","inputRef","useRef","textareaRef","containerRef","ghostRef","textareaPadding","setTextareaPadding","useState","textareaHeight","setTextareaHeight","useEffect","ghost","container","containerStyle","paddingTop","paddingBottom","paddingLeft","paddingRight","containerHeight","availableWidth","contentHeight","availableSpace","VerticalAlign","useImperativeHandle","_a","useMemo","css","HorizontalAlign","toPx","p","inputStyle","decorations","ghostStyle","handleChange","e","handleBlur","isEditable","placeholder","NoteMode","textareaStyle","textareaProps","el","jsxs","jsx","styles","singleLineStyle","commonInputProps","createTextPlugin","fontFamilyOptions","DEFAULT_FONT_FAMILY","universalProperties","placeholderDefinition","fontStyleDefinition","multilineDefinition","validationDefinition","Select","TextPlugin"],"mappings":";;;;;;;;yCAWA,IAAIA,EAAqB,OAAO,IAAI,4BAA4B,EAC9DC,EAAsB,OAAO,IAAI,gBAAgB,EACnD,SAASC,EAAQC,E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MAAOZ,EACP,cAAY,OACZ,SAAQ,GACR,SAAU,GACV,KAAM,EACN,MAAOvF,GAAS,EAAA,CAAA,EAEjBkG,MAAC,WAAA,CAAU,GAAGH,CAAA,CAAe,CAAA,EAC9B,CAEF,CAEA,MAAMK,EAAiC,CACtC,GAAGf,EACH,OAAQ,MAAA,EAGHgB,EAAmB,CACxB,IAAK9C,EACL,MAAOvD,GAAS,GAChB,SAAUwF,EACV,OAAQE,EACR,MAAOU,EACP,YAAAR,EACA,SAAU,CAACD,EACX,SAAUA,EAAa,EAAI,EAAA,EAG5B,OACCO,EAAAA,IAAC,MAAA,CAAI,MAAO9B,EACX,SAAA8B,EAAAA,IAAC,SAAM,KAAK,OAAQ,GAAGG,CAAA,CAAkB,CAAA,CAC1C,CAEF,CAAC,EAEDrD,EAAa,YAAc,eCxRpB,SAASsD,GACfC,EAA6CC,sBACT,CACpC,MAAO,CACN,KAAM,OAEN,KAAM,CACL,YAAa,OACb,YAAa,iBACb,YAAa,CAAE,EAAG,EAAG,EAAG,CAAA,CAAE,EAG3B,SAAUxD,EAEV,WAAY,CACX,GAAGyD,EAAAA,oBACH,GAAGC,EAAAA,sBACH,GAAGC,EAAAA,oBACH,GAAGC,EAAAA,oBACH,GAAGC,EAAAA,qBAEH,WAAY,CACX,aAAc,aACd,MAAO,OACP,MAAO,OACP,UAAWC,EAAAA,OACX,OAAQ,CACP,YAAa,UACb,QAASP,CAAA,CACV,CACD,EAID,cAAgBxF,GAGRA,EAIR,cAAgBf,GACX,OAAOA,GAAU,SAAiBA,EAClC,OAAOA,GAAU,SAAiB,OAAOA,CAAK,EAC3C,IACR,CAEF,CAEO,MAAM+G,GAAgDT,GAAA","x_google_ignoreList":[0,1,2]}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { VerticalAlign as L, HorizontalAlign as W, toPx as S, DEFAULT_FONT_FAMILY as le, Select as se, validationDefinition as ce, multilineDefinition as ue, fontStyleDefinition as fe, placeholderDefinition as de, universalProperties as me } from "@tatamicks/core";
2
- import ge, { forwardRef as be, useRef as H, useState as te, useEffect as he, useImperativeHandle as xe, useMemo as X } from "react";
3
- import './index.css';var M = { exports: {} }, N = {};
1
+ import { VerticalAlign as W, HorizontalAlign as M, toPx as k, NoteMode as te, DEFAULT_FONT_FAMILY as se, Select as ce, validationDefinition as ue, multilineDefinition as fe, fontStyleDefinition as de, placeholderDefinition as me, universalProperties as ge } from "@tatamicks/core";
2
+ import be, { forwardRef as he, useRef as H, useState as re, useEffect as xe, useImperativeHandle as pe, useMemo as Q } from "react";
3
+ import './index.css';var U = { exports: {} }, O = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.js
@@ -10,29 +10,29 @@ import './index.css';var M = { exports: {} }, N = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var re;
14
- function pe() {
15
- if (re) return N;
16
- re = 1;
13
+ var ne;
14
+ function Re() {
15
+ if (ne) return O;
16
+ ne = 1;
17
17
  var t = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
18
- function g(f, c, u) {
19
- var d = null;
20
- if (u !== void 0 && (d = "" + u), c.key !== void 0 && (d = "" + c.key), "key" in c) {
18
+ function b(f, c, u) {
19
+ var h = null;
20
+ if (u !== void 0 && (h = "" + u), c.key !== void 0 && (h = "" + c.key), "key" in c) {
21
21
  u = {};
22
- for (var b in c)
23
- b !== "key" && (u[b] = c[b]);
22
+ for (var d in c)
23
+ d !== "key" && (u[d] = c[d]);
24
24
  } else u = c;
25
25
  return c = u.ref, {
26
26
  $$typeof: t,
27
27
  type: f,
28
- key: d,
28
+ key: h,
29
29
  ref: c !== void 0 ? c : null,
30
30
  props: u
31
31
  };
32
32
  }
33
- return N.Fragment = l, N.jsx = g, N.jsxs = g, N;
33
+ return O.Fragment = l, O.jsx = b, O.jsxs = b, O;
34
34
  }
35
- var C = {};
35
+ var j = {};
36
36
  /**
37
37
  * @license React
38
38
  * react-jsx-runtime.development.js
@@ -42,44 +42,44 @@ var C = {};
42
42
  * This source code is licensed under the MIT license found in the
43
43
  * LICENSE file in the root directory of this source tree.
44
44
  */
45
- var ne;
46
- function Re() {
47
- return ne || (ne = 1, process.env.NODE_ENV !== "production" && (function() {
45
+ var oe;
46
+ function _e() {
47
+ return oe || (oe = 1, process.env.NODE_ENV !== "production" && (function() {
48
48
  function t(e) {
49
49
  if (e == null) return null;
50
50
  if (typeof e == "function")
51
- return e.$$typeof === q ? null : e.displayName || e.name || null;
51
+ return e.$$typeof === R ? null : e.displayName || e.name || null;
52
52
  if (typeof e == "string") return e;
53
53
  switch (e) {
54
- case O:
54
+ case g:
55
55
  return "Fragment";
56
- case Y:
56
+ case D:
57
57
  return "Profiler";
58
- case $:
58
+ case q:
59
59
  return "StrictMode";
60
- case r:
60
+ case Y:
61
61
  return "Suspense";
62
- case s:
62
+ case J:
63
63
  return "SuspenseList";
64
- case m:
64
+ case s:
65
65
  return "Activity";
66
66
  }
67
67
  if (typeof e == "object")
68
68
  switch (typeof e.tag == "number" && console.error(
69
69
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
70
70
  ), e.$$typeof) {
71
- case E:
71
+ case F:
72
72
  return "Portal";
73
- case U:
74
- return e.displayName || "Context";
75
73
  case v:
74
+ return e.displayName || "Context";
75
+ case $:
76
76
  return (e._context.displayName || "Context") + ".Consumer";
77
- case V:
77
+ case K:
78
78
  var n = e.render;
79
79
  return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
80
- case x:
80
+ case B:
81
81
  return n = e.displayName || null, n !== null ? n : t(e.type) || "Memo";
82
- case p:
82
+ case r:
83
83
  n = e._payload, e = e._init;
84
84
  try {
85
85
  return t(e(n));
@@ -91,7 +91,7 @@ function Re() {
91
91
  function l(e) {
92
92
  return "" + e;
93
93
  }
94
- function g(e) {
94
+ function b(e) {
95
95
  try {
96
96
  l(e);
97
97
  var n = !1;
@@ -109,8 +109,8 @@ function Re() {
109
109
  }
110
110
  }
111
111
  function f(e) {
112
- if (e === O) return "<>";
113
- if (typeof e == "object" && e !== null && e.$$typeof === p)
112
+ if (e === g) return "<>";
113
+ if (typeof e == "object" && e !== null && e.$$typeof === r)
114
114
  return "<...>";
115
115
  try {
116
116
  var n = t(e);
@@ -120,22 +120,22 @@ function Re() {
120
120
  }
121
121
  }
122
122
  function c() {
123
- var e = j.A;
123
+ var e = _.A;
124
124
  return e === null ? null : e.getOwner();
125
125
  }
126
126
  function u() {
127
127
  return Error("react-stack-top-frame");
128
128
  }
129
- function d(e) {
130
- if (T.call(e, "key")) {
129
+ function h(e) {
130
+ if (m.call(e, "key")) {
131
131
  var n = Object.getOwnPropertyDescriptor(e, "key").get;
132
132
  if (n && n.isReactWarning) return !1;
133
133
  }
134
134
  return e.key !== void 0;
135
135
  }
136
- function b(e, n) {
136
+ function d(e, n) {
137
137
  function o() {
138
- R || (R = !0, console.error(
138
+ T || (T = !0, console.error(
139
139
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
140
140
  n
141
141
  ));
@@ -145,23 +145,23 @@ function Re() {
145
145
  configurable: !0
146
146
  });
147
147
  }
148
- function F() {
148
+ function V() {
149
149
  var e = t(this.type);
150
- return Z[e] || (Z[e] = !0, console.error(
150
+ return z[e] || (z[e] = !0, console.error(
151
151
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
152
152
  )), e = this.props.ref, e !== void 0 ? e : null;
153
153
  }
154
- function D(e, n, o, a, z, B) {
154
+ function C(e, n, o, a, L, X) {
155
155
  var i = o.ref;
156
156
  return e = {
157
- $$typeof: P,
157
+ $$typeof: I,
158
158
  type: e,
159
159
  key: n,
160
160
  props: o,
161
161
  _owner: a
162
162
  }, (i !== void 0 ? i : null) !== null ? Object.defineProperty(e, "ref", {
163
163
  enumerable: !1,
164
- get: F
164
+ get: V
165
165
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
@@ -176,33 +176,33 @@ function Re() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: z
179
+ value: L
180
180
  }), Object.defineProperty(e, "_debugTask", {
181
181
  configurable: !1,
182
182
  enumerable: !1,
183
183
  writable: !0,
184
- value: B
184
+ value: X
185
185
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
186
186
  }
187
- function w(e, n, o, a, z, B) {
187
+ function S(e, n, o, a, L, X) {
188
188
  var i = n.children;
189
189
  if (i !== void 0)
190
190
  if (a)
191
- if (J(i)) {
191
+ if (G(i)) {
192
192
  for (a = 0; a < i.length; a++)
193
- h(i[a]);
193
+ w(i[a]);
194
194
  Object.freeze && Object.freeze(i);
195
195
  } else
196
196
  console.error(
197
197
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
198
198
  );
199
- else h(i);
200
- if (T.call(n, "key")) {
199
+ else w(i);
200
+ if (m.call(n, "key")) {
201
201
  i = t(e);
202
- var k = Object.keys(n).filter(function(ie) {
203
- return ie !== "key";
202
+ var y = Object.keys(n).filter(function(le) {
203
+ return le !== "key";
204
204
  });
205
- a = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", ee[i + a] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
205
+ a = 0 < y.length ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}", ee[i + a] || (y = 0 < y.length ? "{" + y.join(": ..., ") + ": ...}" : "{}", console.error(
206
206
  `A props object containing a "key" prop is being spread into JSX:
207
207
  let props = %s;
208
208
  <%s {...props} />
@@ -211,105 +211,105 @@ React keys must be passed directly to JSX without using spread:
211
211
  <%s key={someKey} {...props} />`,
212
212
  a,
213
213
  i,
214
- k,
214
+ y,
215
215
  i
216
216
  ), ee[i + a] = !0);
217
217
  }
218
- if (i = null, o !== void 0 && (g(o), i = "" + o), d(n) && (g(n.key), i = "" + n.key), "key" in n) {
218
+ if (i = null, o !== void 0 && (b(o), i = "" + o), h(n) && (b(n.key), i = "" + n.key), "key" in n) {
219
219
  o = {};
220
- for (var G in n)
221
- G !== "key" && (o[G] = n[G]);
220
+ for (var Z in n)
221
+ Z !== "key" && (o[Z] = n[Z]);
222
222
  } else o = n;
223
- return i && b(
223
+ return i && d(
224
224
  o,
225
225
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), D(
226
+ ), C(
227
227
  e,
228
228
  i,
229
229
  o,
230
230
  c(),
231
- z,
232
- B
231
+ L,
232
+ X
233
233
  );
234
234
  }
235
- function h(e) {
236
- A(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === p && (e._payload.status === "fulfilled" ? A(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
235
+ function w(e) {
236
+ x(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === r && (e._payload.status === "fulfilled" ? x(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
237
237
  }
238
- function A(e) {
239
- return typeof e == "object" && e !== null && e.$$typeof === P;
238
+ function x(e) {
239
+ return typeof e == "object" && e !== null && e.$$typeof === I;
240
240
  }
241
- var _ = ge, P = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), Y = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), U = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.activity"), q = Symbol.for("react.client.reference"), j = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, T = Object.prototype.hasOwnProperty, J = Array.isArray, y = console.createTask ? console.createTask : function() {
241
+ var p = be, I = Symbol.for("react.transitional.element"), F = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), v = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), Y = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), r = Symbol.for("react.lazy"), s = Symbol.for("react.activity"), R = Symbol.for("react.client.reference"), _ = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, m = Object.prototype.hasOwnProperty, G = Array.isArray, P = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- _ = {
244
+ p = {
245
245
  react_stack_bottom_frame: function(e) {
246
246
  return e();
247
247
  }
248
248
  };
249
- var R, Z = {}, Q = _.react_stack_bottom_frame.bind(
250
- _,
249
+ var T, z = {}, A = p.react_stack_bottom_frame.bind(
250
+ p,
251
251
  u
252
- )(), K = y(f(u)), ee = {};
253
- C.Fragment = O, C.jsx = function(e, n, o) {
254
- var a = 1e4 > j.recentlyCreatedOwnerStacks++;
255
- return w(
252
+ )(), E = P(f(u)), ee = {};
253
+ j.Fragment = g, j.jsx = function(e, n, o) {
254
+ var a = 1e4 > _.recentlyCreatedOwnerStacks++;
255
+ return S(
256
256
  e,
257
257
  n,
258
258
  o,
259
259
  !1,
260
- a ? Error("react-stack-top-frame") : Q,
261
- a ? y(f(e)) : K
260
+ a ? Error("react-stack-top-frame") : A,
261
+ a ? P(f(e)) : E
262
262
  );
263
- }, C.jsxs = function(e, n, o) {
264
- var a = 1e4 > j.recentlyCreatedOwnerStacks++;
265
- return w(
263
+ }, j.jsxs = function(e, n, o) {
264
+ var a = 1e4 > _.recentlyCreatedOwnerStacks++;
265
+ return S(
266
266
  e,
267
267
  n,
268
268
  o,
269
269
  !0,
270
- a ? Error("react-stack-top-frame") : Q,
271
- a ? y(f(e)) : K
270
+ a ? Error("react-stack-top-frame") : A,
271
+ a ? P(f(e)) : E
272
272
  );
273
273
  };
274
- })()), C;
274
+ })()), j;
275
275
  }
276
- var oe;
277
- function _e() {
278
- return oe || (oe = 1, process.env.NODE_ENV === "production" ? M.exports = pe() : M.exports = Re()), M.exports;
276
+ var ae;
277
+ function Ee() {
278
+ return ae || (ae = 1, process.env.NODE_ENV === "production" ? U.exports = Re() : U.exports = _e()), U.exports;
279
279
  }
280
- var I = _e();
281
- const Ee = "_ghost_tf9uv_15", ve = {
282
- ghost: Ee
283
- }, ae = be(({ props: t, value: l, onChange: g, onBlur: f, readOnly: c }, u) => {
284
- const d = H(null), b = H(null), F = H(null), D = H(null), [w, h] = te({ top: 0, bottom: 0 }), [A, _] = te(null);
285
- he(() => {
280
+ var N = Ee();
281
+ const ve = "_ghost_1spb5_29", Te = {
282
+ ghost: ve
283
+ }, ie = he(({ props: t, value: l, onChange: b, onBlur: f, readOnly: c, mode: u }, h) => {
284
+ const d = H(null), V = H(null), C = H(null), S = H(null), [w, x] = re({ top: 0, bottom: 0 }), [p, I] = re(null);
285
+ xe(() => {
286
286
  if (!t.multiline) return;
287
- const r = D.current, s = F.current;
287
+ const r = S.current, s = C.current;
288
288
  if (!r || !s) return;
289
289
  r.value = l ?? "";
290
- const x = window.getComputedStyle(s), p = Number.parseFloat(x.paddingTop), m = Number.parseFloat(x.paddingBottom), q = Number.parseFloat(x.paddingLeft), j = Number.parseFloat(x.paddingRight), T = s.clientHeight - p - m, J = s.clientWidth - q - j;
291
- r.style.width = `${J}px`, r.style.paddingTop = "0px", r.style.paddingBottom = "0px";
292
- const y = r.scrollHeight;
293
- if (_(T), y < T) {
294
- const R = T - y;
290
+ const R = window.getComputedStyle(s), _ = Number.parseFloat(R.paddingTop), m = Number.parseFloat(R.paddingBottom), G = Number.parseFloat(R.paddingLeft), P = Number.parseFloat(R.paddingRight), T = s.clientHeight - _ - m, z = s.clientWidth - G - P;
291
+ r.style.width = `${z}px`, r.style.paddingTop = "0px", r.style.paddingBottom = "0px";
292
+ const A = r.scrollHeight;
293
+ if (I(T), A < T) {
294
+ const E = T - A;
295
295
  switch (t.alignItems) {
296
- case L.top:
297
- h({ top: 0, bottom: R });
296
+ case W.top:
297
+ x({ top: 0, bottom: E });
298
298
  break;
299
- case L.bottom:
300
- h({ top: R, bottom: 0 });
299
+ case W.bottom:
300
+ x({ top: E, bottom: 0 });
301
301
  break;
302
302
  default:
303
- h({
304
- top: R / 2,
305
- bottom: R / 2
303
+ x({
304
+ top: E / 2,
305
+ bottom: E / 2
306
306
  });
307
307
  break;
308
308
  }
309
309
  } else
310
- h({ top: 0, bottom: 0 });
311
- }, [t, l]), xe(
312
- u,
310
+ x({ top: 0, bottom: 0 });
311
+ }, [t, l]), pe(
312
+ h,
313
313
  () => ({
314
314
  focus: () => {
315
315
  var r;
@@ -318,7 +318,7 @@ const Ee = "_ghost_tf9uv_15", ve = {
318
318
  }),
319
319
  []
320
320
  );
321
- const P = X(() => {
321
+ const F = Q(() => {
322
322
  const r = {
323
323
  width: "100%",
324
324
  height: "100%",
@@ -327,10 +327,10 @@ const Ee = "_ghost_tf9uv_15", ve = {
327
327
  overflow: "hidden"
328
328
  };
329
329
  switch (t.justifyContent) {
330
- case W.center:
330
+ case M.center:
331
331
  r.justifyContent = "center";
332
332
  break;
333
- case W.right:
333
+ case M.right:
334
334
  r.justifyContent = "flex-end";
335
335
  break;
336
336
  default:
@@ -338,10 +338,10 @@ const Ee = "_ghost_tf9uv_15", ve = {
338
338
  break;
339
339
  }
340
340
  switch (t.alignItems) {
341
- case L.top:
341
+ case W.top:
342
342
  r.alignItems = "flex-start";
343
343
  break;
344
- case L.bottom:
344
+ case W.bottom:
345
345
  r.alignItems = "flex-end";
346
346
  break;
347
347
  default:
@@ -349,13 +349,13 @@ const Ee = "_ghost_tf9uv_15", ve = {
349
349
  break;
350
350
  }
351
351
  if (t.isIndividual)
352
- t.top && (r.paddingTop = S.fromDim(t.top)), t.right && (r.paddingRight = S.fromDim(t.right)), t.bottom && (r.paddingBottom = S.fromDim(t.bottom)), t.left && (r.paddingLeft = S.fromDim(t.left));
352
+ t.top && (r.paddingTop = k.fromDim(t.top)), t.right && (r.paddingRight = k.fromDim(t.right)), t.bottom && (r.paddingBottom = k.fromDim(t.bottom)), t.left && (r.paddingLeft = k.fromDim(t.left));
353
353
  else if (t.all) {
354
- const s = S.fromDim(t.all);
354
+ const s = k.fromDim(t.all);
355
355
  r.padding = `${s}px`;
356
356
  }
357
357
  return r;
358
- }, [t]), E = X(() => {
358
+ }, [t]), g = Q(() => {
359
359
  const r = {
360
360
  background: "transparent",
361
361
  border: "none",
@@ -368,13 +368,13 @@ const Ee = "_ghost_tf9uv_15", ve = {
368
368
  fontFamily: "inherit",
369
369
  color: "inherit"
370
370
  };
371
- t.fontSize && (r.fontSize = `${S.fromDim(t.fontSize)}px`), t.fontFamily && (r.fontFamily = t.fontFamily), t.color && (r.color = t.color), r.fontWeight = t.fontWeight ? "bold" : "normal", r.fontStyle = t.italic ? "italic" : "normal";
371
+ t.fontSize && (r.fontSize = `${k.fromDim(t.fontSize)}px`), t.fontFamily && (r.fontFamily = t.fontFamily), t.color && (r.color = t.color), r.fontWeight = t.fontWeight ? "bold" : "normal", r.fontStyle = t.italic ? "italic" : "normal";
372
372
  const s = [];
373
373
  switch (t.underline && s.push("underline"), t.lineThrough && s.push("line-through"), r.textDecoration = s.length > 0 ? s.join(" ") : "none", t.lineHeight && (r.lineHeight = t.lineHeight), t.justifyContent) {
374
- case W.center:
374
+ case M.center:
375
375
  r.textAlign = "center";
376
376
  break;
377
- case W.right:
377
+ case M.right:
378
378
  r.textAlign = "right";
379
379
  break;
380
380
  default:
@@ -382,8 +382,8 @@ const Ee = "_ghost_tf9uv_15", ve = {
382
382
  break;
383
383
  }
384
384
  return r;
385
- }, [t]), O = X(() => ({
386
- ...E,
385
+ }, [t]), q = Q(() => ({
386
+ ...g,
387
387
  position: "absolute",
388
388
  top: 0,
389
389
  left: 0,
@@ -399,40 +399,40 @@ const Ee = "_ghost_tf9uv_15", ve = {
399
399
  border: "none",
400
400
  boxSizing: "border-box",
401
401
  resize: "none"
402
- }), [E]), $ = (r) => {
403
- g(r.target.value);
404
- }, Y = () => {
402
+ }), [g]), D = (r) => {
403
+ b(r.target.value);
404
+ }, $ = () => {
405
405
  f == null || f(l);
406
- }, v = !c;
406
+ }, v = !c, Y = u === te.EDIT || u === te.FORM ? t.placeholder : void 0;
407
407
  if (t.multiline) {
408
408
  const r = {
409
- ...E,
409
+ ...g,
410
410
  resize: "none",
411
411
  overflow: "auto",
412
- height: A !== null ? `${A}px` : "100%",
412
+ height: p !== null ? `${p}px` : "100%",
413
413
  paddingTop: `${w.top}px`,
414
414
  paddingBottom: `${w.bottom}px`
415
- }, p = {
415
+ }, _ = {
416
416
  ref: (m) => {
417
- b.current = m, d.current = m;
417
+ V.current = m, d.current = m;
418
418
  },
419
419
  value: l ?? "",
420
420
  onChange: (m) => {
421
- $(m);
421
+ D(m);
422
422
  },
423
- onBlur: Y,
423
+ onBlur: $,
424
424
  style: r,
425
- placeholder: t.placeholder,
425
+ placeholder: Y,
426
426
  readOnly: !v,
427
427
  tabIndex: v ? 0 : -1
428
428
  };
429
- return /* @__PURE__ */ I.jsxs("div", { ref: F, style: P, children: [
430
- /* @__PURE__ */ I.jsx(
429
+ return /* @__PURE__ */ N.jsxs("div", { ref: C, style: F, children: [
430
+ /* @__PURE__ */ N.jsx(
431
431
  "textarea",
432
432
  {
433
- ref: D,
434
- className: ve.ghost,
435
- style: O,
433
+ ref: S,
434
+ className: Te.ghost,
435
+ style: q,
436
436
  "aria-hidden": "true",
437
437
  readOnly: !0,
438
438
  tabIndex: -1,
@@ -440,26 +440,26 @@ const Ee = "_ghost_tf9uv_15", ve = {
440
440
  value: l ?? ""
441
441
  }
442
442
  ),
443
- /* @__PURE__ */ I.jsx("textarea", { ...p })
443
+ /* @__PURE__ */ N.jsx("textarea", { ..._ })
444
444
  ] });
445
445
  }
446
- const U = {
447
- ...E,
446
+ const J = {
447
+ ...g,
448
448
  height: "100%"
449
- }, V = {
449
+ }, B = {
450
450
  ref: d,
451
451
  value: l ?? "",
452
- onChange: $,
453
- onBlur: Y,
454
- style: U,
455
- placeholder: t.placeholder,
452
+ onChange: D,
453
+ onBlur: $,
454
+ style: J,
455
+ placeholder: Y,
456
456
  readOnly: !v,
457
457
  tabIndex: v ? 0 : -1
458
458
  };
459
- return /* @__PURE__ */ I.jsx("div", { style: P, children: /* @__PURE__ */ I.jsx("input", { type: "text", ...V }) });
459
+ return /* @__PURE__ */ N.jsx("div", { style: F, children: /* @__PURE__ */ N.jsx("input", { type: "text", ...B }) });
460
460
  });
461
- ae.displayName = "TextRenderer";
462
- function Te(t = le) {
461
+ ie.displayName = "TextRenderer";
462
+ function ye(t = se) {
463
463
  return {
464
464
  kind: "text",
465
465
  meta: {
@@ -468,18 +468,18 @@ function Te(t = le) {
468
468
  defaultSize: { w: 4, h: 2 }
469
469
  // デフォルトサイズ
470
470
  },
471
- Renderer: ae,
471
+ Renderer: ie,
472
472
  properties: {
473
+ ...ge,
473
474
  ...me,
474
475
  ...de,
475
476
  ...fe,
476
477
  ...ue,
477
- ...ce,
478
478
  fontFamily: {
479
479
  defaultValue: "sans-serif",
480
480
  label: "フォント",
481
481
  group: "フォント",
482
- Component: se,
482
+ Component: ce,
483
483
  config: {
484
484
  placeholder: "フォントを選択",
485
485
  options: t
@@ -492,10 +492,10 @@ function Te(t = le) {
492
492
  validateValue: (l) => typeof l == "string" ? l : typeof l == "number" ? String(l) : null
493
493
  };
494
494
  }
495
- const Se = Te();
495
+ const we = ye();
496
496
  export {
497
- Se as TextPlugin,
498
- ae as TextRenderer,
499
- Te as createTextPlugin
497
+ we as TextPlugin,
498
+ ie as TextRenderer,
499
+ ye as createTextPlugin
500
500
  };
501
501
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/react/jsx-runtime.js","../src/TextRenderer.tsx","../src/TextPlugin.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import {\n\ttype CSSProperties,\n\tforwardRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport {\n\ttype BlockRef,\n\tHorizontalAlign,\n\ttype RendererProps,\n\ttoPx,\n\tVerticalAlign,\n} from \"@tatamicks/core\";\n\nimport styles from \"./TextRenderer.module.css\";\n\nimport type { TextProps, TextValue } from \"./types\";\n\nexport const TextRenderer = forwardRef<\n\tBlockRef,\n\tRendererProps<TextProps, TextValue>\n>(({ props, value, onChange, onBlur, readOnly }, ref) => {\n\t// 入力要素への参照\n\tconst inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst ghostRef = useRef<HTMLTextAreaElement>(null);\n\n\tconst [textareaPadding, setTextareaPadding] = useState({ top: 0, bottom: 0 });\n\tconst [textareaHeight, setTextareaHeight] = useState<number | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!props.multiline) return;\n\n\t\tconst ghost = ghostRef.current;\n\t\tconst container = containerRef.current;\n\t\tif (!ghost || !container) return;\n\n\t\tghost.value = value ?? \"\";\n\n\t\tconst containerStyle = window.getComputedStyle(container);\n\t\tconst paddingTop = Number.parseFloat(containerStyle.paddingTop);\n\t\tconst paddingBottom = Number.parseFloat(containerStyle.paddingBottom);\n\t\tconst paddingLeft = Number.parseFloat(containerStyle.paddingLeft);\n\t\tconst paddingRight = Number.parseFloat(containerStyle.paddingRight);\n\n\t\tconst containerHeight = container.clientHeight - paddingTop - paddingBottom;\n\t\tconst availableWidth = container.clientWidth - paddingLeft - paddingRight;\n\n\t\tghost.style.width = `${availableWidth}px`;\n\t\tghost.style.paddingTop = \"0px\";\n\t\tghost.style.paddingBottom = \"0px\";\n\n\t\tconst contentHeight = ghost.scrollHeight;\n\n\t\tsetTextareaHeight(containerHeight);\n\n\t\tif (contentHeight < containerHeight) {\n\t\t\tconst availableSpace = containerHeight - contentHeight;\n\n\t\t\tswitch (props.alignItems) {\n\t\t\t\tcase VerticalAlign.top:\n\t\t\t\t\tsetTextareaPadding({ top: 0, bottom: availableSpace });\n\t\t\t\t\tbreak;\n\t\t\t\tcase VerticalAlign.bottom:\n\t\t\t\t\tsetTextareaPadding({ top: availableSpace, bottom: 0 });\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsetTextareaPadding({\n\t\t\t\t\t\ttop: availableSpace / 2,\n\t\t\t\t\t\tbottom: availableSpace / 2,\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tsetTextareaPadding({ top: 0, bottom: 0 });\n\t\t}\n\t}, [props, value]);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tfocus: () => {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t},\n\t\t}),\n\t\t[],\n\t);\n\n\tconst containerStyle = useMemo((): CSSProperties => {\n\t\tconst css: CSSProperties = {\n\t\t\twidth: \"100%\",\n\t\t\theight: \"100%\",\n\t\t\tdisplay: \"flex\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\toverflow: \"hidden\",\n\t\t};\n\n\t\tswitch (props.justifyContent) {\n\t\t\tcase HorizontalAlign.center:\n\t\t\t\tcss.justifyContent = \"center\";\n\t\t\t\tbreak;\n\t\t\tcase HorizontalAlign.right:\n\t\t\t\tcss.justifyContent = \"flex-end\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcss.justifyContent = \"flex-start\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tswitch (props.alignItems) {\n\t\t\tcase VerticalAlign.top:\n\t\t\t\tcss.alignItems = \"flex-start\";\n\t\t\t\tbreak;\n\t\t\tcase VerticalAlign.bottom:\n\t\t\t\tcss.alignItems = \"flex-end\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcss.alignItems = \"center\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (props.isIndividual) {\n\t\t\tif (props.top) css.paddingTop = toPx.fromDim(props.top);\n\t\t\tif (props.right) css.paddingRight = toPx.fromDim(props.right);\n\t\t\tif (props.bottom) css.paddingBottom = toPx.fromDim(props.bottom);\n\t\t\tif (props.left) css.paddingLeft = toPx.fromDim(props.left);\n\t\t} else if (props.all) {\n\t\t\tconst p = toPx.fromDim(props.all);\n\t\t\tcss.padding = `${p}px`;\n\t\t}\n\n\t\treturn css;\n\t}, [props]);\n\n\tconst inputStyle = useMemo((): CSSProperties => {\n\t\tconst css: CSSProperties = {\n\t\t\tbackground: \"transparent\",\n\t\t\tborder: \"none\",\n\t\t\toutline: \"none\",\n\t\t\tresize: \"none\",\n\t\t\tpadding: 0,\n\t\t\tmargin: 0,\n\t\t\twidth: \"100%\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tfontFamily: \"inherit\",\n\t\t\tcolor: \"inherit\",\n\t\t};\n\n\t\tif (props.fontSize) {\n\t\t\tcss.fontSize = `${toPx.fromDim(props.fontSize)}px`;\n\t\t}\n\n\t\tif (props.fontFamily) css.fontFamily = props.fontFamily;\n\t\tif (props.color) css.color = props.color;\n\n\t\tcss.fontWeight = props.fontWeight ? \"bold\" : \"normal\";\n\t\tcss.fontStyle = props.italic ? \"italic\" : \"normal\";\n\n\t\tconst decorations: string[] = [];\n\t\tif (props.underline) decorations.push(\"underline\");\n\t\tif (props.lineThrough) decorations.push(\"line-through\");\n\t\tcss.textDecoration =\n\t\t\tdecorations.length > 0 ? decorations.join(\" \") : \"none\";\n\n\t\tif (props.lineHeight) css.lineHeight = props.lineHeight;\n\n\t\tswitch (props.justifyContent) {\n\t\t\tcase HorizontalAlign.center:\n\t\t\t\tcss.textAlign = \"center\";\n\t\t\t\tbreak;\n\t\t\tcase HorizontalAlign.right:\n\t\t\t\tcss.textAlign = \"right\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcss.textAlign = \"left\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn css;\n\t}, [props]);\n\n\tconst ghostStyle = useMemo((): CSSProperties => {\n\t\treturn {\n\t\t\t...inputStyle,\n\t\t\tposition: \"absolute\",\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: \"100%\",\n\t\t\theight: \"auto\",\n\t\t\tvisibility: \"hidden\",\n\t\t\tpointerEvents: \"none\",\n\t\t\toverflow: \"hidden\",\n\t\t\twhiteSpace: \"pre-wrap\",\n\t\t\twordWrap: \"break-word\",\n\t\t\toverflowWrap: \"break-word\",\n\t\t\tpadding: 0,\n\t\t\tborder: \"none\",\n\t\t\tboxSizing: \"border-box\",\n\t\t\tresize: \"none\",\n\t\t};\n\t}, [inputStyle]);\n\n\tconst handleChange = (\n\t\te: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n\t) => {\n\t\tonChange(e.target.value);\n\t};\n\n\tconst handleBlur = () => {\n\t\tonBlur?.(value);\n\t};\n\n\tconst isEditable = !readOnly;\n\n\tif (props.multiline) {\n\t\tconst textareaStyle: CSSProperties = {\n\t\t\t...inputStyle,\n\t\t\tresize: \"none\",\n\t\t\toverflow: \"auto\",\n\t\t\theight: textareaHeight !== null ? `${textareaHeight}px` : \"100%\",\n\t\t\tpaddingTop: `${textareaPadding.top}px`,\n\t\t\tpaddingBottom: `${textareaPadding.bottom}px`,\n\t\t};\n\n\t\tconst handleTextareaChange = (\n\t\t\te: React.ChangeEvent<HTMLTextAreaElement>,\n\t\t) => {\n\t\t\thandleChange(e);\n\t\t};\n\n\t\tconst setTextareaRefs = (el: HTMLTextAreaElement | null) => {\n\t\t\ttextareaRef.current = el;\n\t\t\tinputRef.current = el;\n\t\t};\n\n\t\tconst textareaProps = {\n\t\t\tref: setTextareaRefs,\n\t\t\tvalue: value ?? \"\",\n\t\t\tonChange: handleTextareaChange,\n\t\t\tonBlur: handleBlur,\n\t\t\tstyle: textareaStyle,\n\t\t\tplaceholder: props.placeholder,\n\t\t\treadOnly: !isEditable,\n\t\t\ttabIndex: isEditable ? 0 : -1,\n\t\t};\n\n\t\treturn (\n\t\t\t<div ref={containerRef} style={containerStyle}>\n\t\t\t\t<textarea\n\t\t\t\t\tref={ghostRef}\n\t\t\t\t\tclassName={styles.ghost}\n\t\t\t\t\tstyle={ghostStyle}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\treadOnly\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\trows={1}\n\t\t\t\t\tvalue={value ?? \"\"}\n\t\t\t\t/>\n\t\t\t\t<textarea {...textareaProps} />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst singleLineStyle: CSSProperties = {\n\t\t...inputStyle,\n\t\theight: \"100%\",\n\t};\n\n\tconst commonInputProps = {\n\t\tref: inputRef as React.RefObject<HTMLInputElement>,\n\t\tvalue: value ?? \"\",\n\t\tonChange: handleChange,\n\t\tonBlur: handleBlur,\n\t\tstyle: singleLineStyle,\n\t\tplaceholder: props.placeholder,\n\t\treadOnly: !isEditable,\n\t\ttabIndex: isEditable ? 0 : -1,\n\t};\n\n\treturn (\n\t\t<div style={containerStyle}>\n\t\t\t<input type=\"text\" {...commonInputProps} />\n\t\t</div>\n\t);\n});\n\nTextRenderer.displayName = \"TextRenderer\";\n","import {\n\ttype BlockPlugin,\n\tDEFAULT_FONT_FAMILY,\n\tfontStyleDefinition,\n\tmultilineDefinition,\n\tplaceholderDefinition,\n\tSelect,\n\ttype SelectOption,\n\tuniversalProperties,\n\tvalidationDefinition,\n} from \"@tatamicks/core\";\n\nimport { TextRenderer } from \"./TextRenderer\";\n\nimport type { TextProps, TextValue } from \"./types\";\n\nexport function createTextPlugin(\n\tfontFamilyOptions: readonly SelectOption[] = DEFAULT_FONT_FAMILY,\n): BlockPlugin<TextProps, TextValue> {\n\treturn {\n\t\tkind: \"text\",\n\n\t\tmeta: {\n\t\t\tdisplayName: \"テキスト\",\n\t\t\tdescription: \"リッチなテキスト編集ブロック\",\n\t\t\tdefaultSize: { w: 4, h: 2 }, // デフォルトサイズ\n\t\t},\n\n\t\tRenderer: TextRenderer,\n\n\t\tproperties: {\n\t\t\t...universalProperties,\n\t\t\t...placeholderDefinition,\n\t\t\t...fontStyleDefinition,\n\t\t\t...multilineDefinition,\n\t\t\t...validationDefinition,\n\n\t\t\tfontFamily: {\n\t\t\t\tdefaultValue: \"sans-serif\",\n\t\t\t\tlabel: \"フォント\",\n\t\t\t\tgroup: \"フォント\",\n\t\t\t\tComponent: Select,\n\t\t\t\tconfig: {\n\t\t\t\t\tplaceholder: \"フォントを選択\",\n\t\t\t\t\toptions: fontFamilyOptions,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t// バリデーション (Propsの型チェックと初期化)\n\t\tvalidateProps: (props: unknown): TextProps => {\n\t\t\t// createInitialPropsを通すので、基本的にはキャストでOKですが、\n\t\t\t// 必要に応じて厳密なチェックを行います\n\t\t\treturn props as TextProps;\n\t\t},\n\n\t\t// 値のバリデーション\n\t\tvalidateValue: (value: unknown): TextValue | null => {\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\") return String(value);\n\t\t\treturn null;\n\t\t},\n\t};\n}\n\nexport const TextPlugin: BlockPlugin<TextProps, TextValue> = createTextPlugin();\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","TextRenderer","forwardRef","onChange","onBlur","readOnly","ref","inputRef","useRef","textareaRef","containerRef","ghostRef","textareaPadding","setTextareaPadding","useState","textareaHeight","setTextareaHeight","useEffect","ghost","container","containerStyle","paddingTop","paddingBottom","paddingLeft","paddingRight","containerHeight","availableWidth","contentHeight","availableSpace","VerticalAlign","useImperativeHandle","_a","useMemo","css","HorizontalAlign","toPx","p","inputStyle","decorations","ghostStyle","handleChange","e","handleBlur","isEditable","textareaStyle","textareaProps","el","jsxs","jsx","styles","singleLineStyle","commonInputProps","createTextPlugin","fontFamilyOptions","DEFAULT_FONT_FAMILY","universalProperties","placeholderDefinition","fontStyleDefinition","multilineDefinition","validationDefinition","Select","TextPlugin"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAIA,IAAqB,OAAO,IAAI,4BAA4B,GAC9DC,IAAsB,OAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0BE,IAAM,KAAKF,EAAO,MACxC,SAASA,GAAQ;AACnB,MAAAC,IAAW,CAAA;AACX,eAASE,KAAYH;AACnB,QAAUG,MAAV,UAAuBF,EAASE,CAAQ,IAAIH,EAAOG,CAAQ;AAAA,IACjE,MAAS,CAAAF,IAAWD;AAClB,WAAAA,IAASC,EAAS,KACX;AAAA,MACL,UAAUL;AAAA,MACV,MAAMG;AAAA,MACN,KAAKG;AAAA,MACL,KAAgBF,MAAX,SAAoBA,IAAS;AAAA,MAClC,OAAOC;AAAA;EAEX;AACA,SAAAG,EAAA,WAAmBP,GACnBO,EAAA,MAAcN,GACdM,EAAA,OAAeN;;;;;;;;;;;;;;wBCtBE,QAAQ,IAAI,aAA7B,iBACG,WAAY;AACX,aAASO,EAAyBN,GAAM;AACtC,UAAYA,KAAR,KAAc,QAAO;AACzB,UAAmB,OAAOA,KAAtB;AACF,eAAOA,EAAK,aAAaO,IACrB,OACAP,EAAK,eAAeA,EAAK,QAAQ;AACvC,UAAiB,OAAOA,KAApB,SAA0B,QAAOA;AACrC,cAAQA,GAAI;AAAA,Q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,EAAA,CAAkB,EAAA,CAC1C;AAEF,CAAC;AAEDlD,GAAa,cAAc;AClRpB,SAASmD,GACfC,IAA6CC,IACT;AACpC,SAAO;AAAA,IACN,MAAM;AAAA,IAEN,MAAM;AAAA,MACL,aAAa;AAAA,MACb,aAAa;AAAA,MACb,aAAa,EAAE,GAAG,GAAG,GAAG,EAAA;AAAA;AAAA,IAAE;AAAA,IAG3B,UAAUrD;AAAA,IAEV,YAAY;AAAA,MACX,GAAGsD;AAAA,MACH,GAAGC;AAAA,MACH,GAAGC;AAAA,MACH,GAAGC;AAAA,MACH,GAAGC;AAAA,MAEH,YAAY;AAAA,QACX,cAAc;AAAA,QACd,OAAO;AAAA,QACP,OAAO;AAAA,QACP,WAAWC;AAAA,QACX,QAAQ;AAAA,UACP,aAAa;AAAA,UACb,SAASP;AAAA,QAAA;AAAA,MACV;AAAA,IACD;AAAA;AAAA,IAID,eAAe,CAACrF,MAGRA;AAAA;AAAA,IAIR,eAAe,CAACf,MACX,OAAOA,KAAU,WAAiBA,IAClC,OAAOA,KAAU,WAAiB,OAAOA,CAAK,IAC3C;AAAA,EACR;AAEF;AAEO,MAAM4G,KAAgDT,GAAA;","x_google_ignoreList":[0,1,2]}
1
+ {"version":3,"file":"index.mjs","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.js","../../../node_modules/react/cjs/react-jsx-runtime.development.js","../../../node_modules/react/jsx-runtime.js","../src/TextRenderer.tsx","../src/TextPlugin.ts"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function jsxDEVImpl(\n type,\n config,\n maybeKey,\n isStaticChildren,\n debugStack,\n debugTask\n ) {\n var children = config.children;\n if (void 0 !== children)\n if (isStaticChildren)\n if (isArrayImpl(children)) {\n for (\n isStaticChildren = 0;\n isStaticChildren < children.length;\n isStaticChildren++\n )\n validateChildKeys(children[isStaticChildren]);\n Object.freeze && Object.freeze(children);\n } else\n console.error(\n \"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.\"\n );\n else validateChildKeys(children);\n if (hasOwnProperty.call(config, \"key\")) {\n children = getComponentNameFromType(type);\n var keys = Object.keys(config).filter(function (k) {\n return \"key\" !== k;\n });\n isStaticChildren =\n 0 < keys.length\n ? \"{key: someKey, \" + keys.join(\": ..., \") + \": ...}\"\n : \"{key: someKey}\";\n didWarnAboutKeySpread[children + isStaticChildren] ||\n ((keys =\n 0 < keys.length ? \"{\" + keys.join(\": ..., \") + \": ...}\" : \"{}\"),\n console.error(\n 'A props object containing a \"key\" prop is being spread into JSX:\\n let props = %s;\\n <%s {...props} />\\nReact keys must be passed directly to JSX without using spread:\\n let props = %s;\\n <%s key={someKey} {...props} />',\n isStaticChildren,\n children,\n keys,\n children\n ),\n (didWarnAboutKeySpread[children + isStaticChildren] = !0));\n }\n children = null;\n void 0 !== maybeKey &&\n (checkKeyStringCoercion(maybeKey), (children = \"\" + maybeKey));\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (children = \"\" + config.key));\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n children &&\n defineKeyPropWarningGetter(\n maybeKey,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n return ReactElement(\n type,\n children,\n maybeKey,\n getOwner(),\n debugStack,\n debugTask\n );\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n var React = require(\"react\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n hasOwnProperty = Object.prototype.hasOwnProperty,\n isArrayImpl = Array.isArray,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n React = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(\n React,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutKeySpread = {};\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.jsx = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !1,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.jsxs = function (type, config, maybeKey) {\n var trackActualOwner =\n 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return jsxDEVImpl(\n type,\n config,\n maybeKey,\n !0,\n trackActualOwner\n ? Error(\"react-stack-top-frame\")\n : unknownOwnerDebugStack,\n trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import {\r\n\ttype CSSProperties,\r\n\tforwardRef,\r\n\tuseEffect,\r\n\tuseImperativeHandle,\r\n\tuseMemo,\r\n\tuseRef,\r\n\tuseState,\r\n} from \"react\";\r\nimport {\r\n\ttype BlockRef,\r\n\tHorizontalAlign,\r\n\tNoteMode,\r\n\ttype RendererProps,\r\n\ttoPx,\r\n\tVerticalAlign,\r\n} from \"@tatamicks/core\";\r\n\r\nimport styles from \"./TextRenderer.module.css\";\r\n\r\nimport type { TextProps, TextValue } from \"./types\";\r\n\r\nexport const TextRenderer = forwardRef<\r\n\tBlockRef,\r\n\tRendererProps<TextProps, TextValue>\r\n>(({ props, value, onChange, onBlur, readOnly, mode }, ref) => {\r\n\t// 入力要素への参照\r\n\tconst inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\r\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\r\n\tconst containerRef = useRef<HTMLDivElement>(null);\r\n\tconst ghostRef = useRef<HTMLTextAreaElement>(null);\r\n\r\n\tconst [textareaPadding, setTextareaPadding] = useState({ top: 0, bottom: 0 });\r\n\tconst [textareaHeight, setTextareaHeight] = useState<number | null>(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!props.multiline) return;\r\n\r\n\t\tconst ghost = ghostRef.current;\r\n\t\tconst container = containerRef.current;\r\n\t\tif (!ghost || !container) return;\r\n\r\n\t\tghost.value = value ?? \"\";\r\n\r\n\t\tconst containerStyle = window.getComputedStyle(container);\r\n\t\tconst paddingTop = Number.parseFloat(containerStyle.paddingTop);\r\n\t\tconst paddingBottom = Number.parseFloat(containerStyle.paddingBottom);\r\n\t\tconst paddingLeft = Number.parseFloat(containerStyle.paddingLeft);\r\n\t\tconst paddingRight = Number.parseFloat(containerStyle.paddingRight);\r\n\r\n\t\tconst containerHeight = container.clientHeight - paddingTop - paddingBottom;\r\n\t\tconst availableWidth = container.clientWidth - paddingLeft - paddingRight;\r\n\r\n\t\tghost.style.width = `${availableWidth}px`;\r\n\t\tghost.style.paddingTop = \"0px\";\r\n\t\tghost.style.paddingBottom = \"0px\";\r\n\r\n\t\tconst contentHeight = ghost.scrollHeight;\r\n\r\n\t\tsetTextareaHeight(containerHeight);\r\n\r\n\t\tif (contentHeight < containerHeight) {\r\n\t\t\tconst availableSpace = containerHeight - contentHeight;\r\n\r\n\t\t\tswitch (props.alignItems) {\r\n\t\t\t\tcase VerticalAlign.top:\r\n\t\t\t\t\tsetTextareaPadding({ top: 0, bottom: availableSpace });\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase VerticalAlign.bottom:\r\n\t\t\t\t\tsetTextareaPadding({ top: availableSpace, bottom: 0 });\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsetTextareaPadding({\r\n\t\t\t\t\t\ttop: availableSpace / 2,\r\n\t\t\t\t\t\tbottom: availableSpace / 2,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tsetTextareaPadding({ top: 0, bottom: 0 });\r\n\t\t}\r\n\t}, [props, value]);\r\n\r\n\tuseImperativeHandle(\r\n\t\tref,\r\n\t\t() => ({\r\n\t\t\tfocus: () => {\r\n\t\t\t\tinputRef.current?.focus();\r\n\t\t\t},\r\n\t\t}),\r\n\t\t[],\r\n\t);\r\n\r\n\tconst containerStyle = useMemo((): CSSProperties => {\r\n\t\tconst css: CSSProperties = {\r\n\t\t\twidth: \"100%\",\r\n\t\t\theight: \"100%\",\r\n\t\t\tdisplay: \"flex\",\r\n\t\t\tboxSizing: \"border-box\",\r\n\t\t\toverflow: \"hidden\",\r\n\t\t};\r\n\r\n\t\tswitch (props.justifyContent) {\r\n\t\t\tcase HorizontalAlign.center:\r\n\t\t\t\tcss.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase HorizontalAlign.right:\r\n\t\t\t\tcss.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcss.justifyContent = \"flex-start\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tswitch (props.alignItems) {\r\n\t\t\tcase VerticalAlign.top:\r\n\t\t\t\tcss.alignItems = \"flex-start\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase VerticalAlign.bottom:\r\n\t\t\t\tcss.alignItems = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcss.alignItems = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif (props.isIndividual) {\r\n\t\t\tif (props.top) css.paddingTop = toPx.fromDim(props.top);\r\n\t\t\tif (props.right) css.paddingRight = toPx.fromDim(props.right);\r\n\t\t\tif (props.bottom) css.paddingBottom = toPx.fromDim(props.bottom);\r\n\t\t\tif (props.left) css.paddingLeft = toPx.fromDim(props.left);\r\n\t\t} else if (props.all) {\r\n\t\t\tconst p = toPx.fromDim(props.all);\r\n\t\t\tcss.padding = `${p}px`;\r\n\t\t}\r\n\r\n\t\treturn css;\r\n\t}, [props]);\r\n\r\n\tconst inputStyle = useMemo((): CSSProperties => {\r\n\t\tconst css: CSSProperties = {\r\n\t\t\tbackground: \"transparent\",\r\n\t\t\tborder: \"none\",\r\n\t\t\toutline: \"none\",\r\n\t\t\tresize: \"none\",\r\n\t\t\tpadding: 0,\r\n\t\t\tmargin: 0,\r\n\t\t\twidth: \"100%\",\r\n\t\t\tboxSizing: \"border-box\",\r\n\t\t\tfontFamily: \"inherit\",\r\n\t\t\tcolor: \"inherit\",\r\n\t\t};\r\n\r\n\t\tif (props.fontSize) {\r\n\t\t\tcss.fontSize = `${toPx.fromDim(props.fontSize)}px`;\r\n\t\t}\r\n\r\n\t\tif (props.fontFamily) css.fontFamily = props.fontFamily;\r\n\t\tif (props.color) css.color = props.color;\r\n\r\n\t\tcss.fontWeight = props.fontWeight ? \"bold\" : \"normal\";\r\n\t\tcss.fontStyle = props.italic ? \"italic\" : \"normal\";\r\n\r\n\t\tconst decorations: string[] = [];\r\n\t\tif (props.underline) decorations.push(\"underline\");\r\n\t\tif (props.lineThrough) decorations.push(\"line-through\");\r\n\t\tcss.textDecoration =\r\n\t\t\tdecorations.length > 0 ? decorations.join(\" \") : \"none\";\r\n\r\n\t\tif (props.lineHeight) css.lineHeight = props.lineHeight;\r\n\r\n\t\tswitch (props.justifyContent) {\r\n\t\t\tcase HorizontalAlign.center:\r\n\t\t\t\tcss.textAlign = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase HorizontalAlign.right:\r\n\t\t\t\tcss.textAlign = \"right\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tcss.textAlign = \"left\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn css;\r\n\t}, [props]);\r\n\r\n\tconst ghostStyle = useMemo((): CSSProperties => {\r\n\t\treturn {\r\n\t\t\t...inputStyle,\r\n\t\t\tposition: \"absolute\",\r\n\t\t\ttop: 0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: \"100%\",\r\n\t\t\theight: \"auto\",\r\n\t\t\tvisibility: \"hidden\",\r\n\t\t\tpointerEvents: \"none\",\r\n\t\t\toverflow: \"hidden\",\r\n\t\t\twhiteSpace: \"pre-wrap\",\r\n\t\t\twordWrap: \"break-word\",\r\n\t\t\toverflowWrap: \"break-word\",\r\n\t\t\tpadding: 0,\r\n\t\t\tborder: \"none\",\r\n\t\t\tboxSizing: \"border-box\",\r\n\t\t\tresize: \"none\",\r\n\t\t};\r\n\t}, [inputStyle]);\r\n\r\n\tconst handleChange = (\r\n\t\te: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\r\n\t) => {\r\n\t\tonChange(e.target.value);\r\n\t};\r\n\r\n\tconst handleBlur = () => {\r\n\t\tonBlur?.(value);\r\n\t};\r\n\r\n\tconst isEditable = !readOnly;\r\n\r\n\t// プレースホルダーはEDIT/FORMモードでのみ表示\r\n\tconst shouldShowPlaceholder =\r\n\t\tmode === NoteMode.EDIT || mode === NoteMode.FORM;\r\n\tconst placeholder = shouldShowPlaceholder ? props.placeholder : undefined;\r\n\r\n\tif (props.multiline) {\r\n\t\tconst textareaStyle: CSSProperties = {\r\n\t\t\t...inputStyle,\r\n\t\t\tresize: \"none\",\r\n\t\t\toverflow: \"auto\",\r\n\t\t\theight: textareaHeight !== null ? `${textareaHeight}px` : \"100%\",\r\n\t\t\tpaddingTop: `${textareaPadding.top}px`,\r\n\t\t\tpaddingBottom: `${textareaPadding.bottom}px`,\r\n\t\t};\r\n\r\n\t\tconst handleTextareaChange = (\r\n\t\t\te: React.ChangeEvent<HTMLTextAreaElement>,\r\n\t\t) => {\r\n\t\t\thandleChange(e);\r\n\t\t};\r\n\r\n\t\tconst setTextareaRefs = (el: HTMLTextAreaElement | null) => {\r\n\t\t\ttextareaRef.current = el;\r\n\t\t\tinputRef.current = el;\r\n\t\t};\r\n\r\n\t\tconst textareaProps = {\r\n\t\t\tref: setTextareaRefs,\r\n\t\t\tvalue: value ?? \"\",\r\n\t\t\tonChange: handleTextareaChange,\r\n\t\t\tonBlur: handleBlur,\r\n\t\t\tstyle: textareaStyle,\r\n\t\t\tplaceholder: placeholder,\r\n\t\t\treadOnly: !isEditable,\r\n\t\t\ttabIndex: isEditable ? 0 : -1,\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<div ref={containerRef} style={containerStyle}>\r\n\t\t\t\t<textarea\r\n\t\t\t\t\tref={ghostRef}\r\n\t\t\t\t\tclassName={styles.ghost}\r\n\t\t\t\t\tstyle={ghostStyle}\r\n\t\t\t\t\taria-hidden=\"true\"\r\n\t\t\t\t\treadOnly\r\n\t\t\t\t\ttabIndex={-1}\r\n\t\t\t\t\trows={1}\r\n\t\t\t\t\tvalue={value ?? \"\"}\r\n\t\t\t\t/>\r\n\t\t\t\t<textarea {...textareaProps} />\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n\r\n\tconst singleLineStyle: CSSProperties = {\r\n\t\t...inputStyle,\r\n\t\theight: \"100%\",\r\n\t};\r\n\r\n\tconst commonInputProps = {\r\n\t\tref: inputRef as React.RefObject<HTMLInputElement>,\r\n\t\tvalue: value ?? \"\",\r\n\t\tonChange: handleChange,\r\n\t\tonBlur: handleBlur,\r\n\t\tstyle: singleLineStyle,\r\n\t\tplaceholder: placeholder,\r\n\t\treadOnly: !isEditable,\r\n\t\ttabIndex: isEditable ? 0 : -1,\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div style={containerStyle}>\r\n\t\t\t<input type=\"text\" {...commonInputProps} />\r\n\t\t</div>\r\n\t);\r\n});\r\n\r\nTextRenderer.displayName = \"TextRenderer\";\r\n","import {\n\ttype BlockPlugin,\n\tDEFAULT_FONT_FAMILY,\n\tfontStyleDefinition,\n\tmultilineDefinition,\n\tplaceholderDefinition,\n\tSelect,\n\ttype SelectOption,\n\tuniversalProperties,\n\tvalidationDefinition,\n} from \"@tatamicks/core\";\n\nimport { TextRenderer } from \"./TextRenderer\";\n\nimport type { TextProps, TextValue } from \"./types\";\n\nexport function createTextPlugin(\n\tfontFamilyOptions: readonly SelectOption[] = DEFAULT_FONT_FAMILY,\n): BlockPlugin<TextProps, TextValue> {\n\treturn {\n\t\tkind: \"text\",\n\n\t\tmeta: {\n\t\t\tdisplayName: \"テキスト\",\n\t\t\tdescription: \"リッチなテキスト編集ブロック\",\n\t\t\tdefaultSize: { w: 4, h: 2 }, // デフォルトサイズ\n\t\t},\n\n\t\tRenderer: TextRenderer,\n\n\t\tproperties: {\n\t\t\t...universalProperties,\n\t\t\t...placeholderDefinition,\n\t\t\t...fontStyleDefinition,\n\t\t\t...multilineDefinition,\n\t\t\t...validationDefinition,\n\n\t\t\tfontFamily: {\n\t\t\t\tdefaultValue: \"sans-serif\",\n\t\t\t\tlabel: \"フォント\",\n\t\t\t\tgroup: \"フォント\",\n\t\t\t\tComponent: Select,\n\t\t\t\tconfig: {\n\t\t\t\t\tplaceholder: \"フォントを選択\",\n\t\t\t\t\toptions: fontFamilyOptions,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\n\t\t// バリデーション (Propsの型チェックと初期化)\n\t\tvalidateProps: (props: unknown): TextProps => {\n\t\t\t// createInitialPropsを通すので、基本的にはキャストでOKですが、\n\t\t\t// 必要に応じて厳密なチェックを行います\n\t\t\treturn props as TextProps;\n\t\t},\n\n\t\t// 値のバリデーション\n\t\tvalidateValue: (value: unknown): TextValue | null => {\n\t\t\tif (typeof value === \"string\") return value;\n\t\t\tif (typeof value === \"number\") return String(value);\n\t\t\treturn null;\n\t\t},\n\t};\n}\n\nexport const TextPlugin: BlockPlugin<TextProps, TextValue> = createTextPlugin();\n"],"names":["REACT_ELEMENT_TYPE","REACT_FRAGMENT_TYPE","jsxProd","type","config","maybeKey","key","propName","reactJsxRuntime_production","getComponentNameFromType","REACT_CLIENT_REFERENCE","REACT_PROFILER_TYPE","REACT_STRICT_MODE_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_ACTIVITY_TYPE","REACT_PORTAL_TYPE","REACT_CONTEXT_TYPE","REACT_CONSUMER_TYPE","REACT_FORWARD_REF_TYPE","innerType","REACT_MEMO_TYPE","REACT_LAZY_TYPE","testStringCoercion","value","checkKeyStringCoercion","JSCompiler_inline_result","JSCompiler_temp_const","JSCompiler_inline_result$jscomp$0","getTaskName","name","getOwner","dispatcher","ReactSharedInternals","UnknownOwner","hasValidKey","hasOwnProperty","getter","defineKeyPropWarningGetter","props","displayName","warnAboutAccessingKey","specialPropKeyWarningShown","elementRefGetterWithDeprecationWarning","componentName","didWarnAboutElementRef","ReactElement","owner","debugStack","debugTask","refProp","jsxDEVImpl","isStaticChildren","children","isArrayImpl","validateChildKeys","keys","k","didWarnAboutKeySpread","node","isValidElement","object","React","require$$0","createTask","callStackForError","unknownOwnerDebugStack","unknownOwnerDebugTask","reactJsxRuntime_development","trackActualOwner","jsxRuntimeModule","require$$1","TextRenderer","forwardRef","onChange","onBlur","readOnly","mode","ref","inputRef","useRef","textareaRef","containerRef","ghostRef","textareaPadding","setTextareaPadding","useState","textareaHeight","setTextareaHeight","useEffect","ghost","container","containerStyle","paddingTop","paddingBottom","paddingLeft","paddingRight","containerHeight","availableWidth","contentHeight","availableSpace","VerticalAlign","useImperativeHandle","_a","useMemo","css","HorizontalAlign","toPx","p","inputStyle","decorations","ghostStyle","handleChange","e","handleBlur","isEditable","placeholder","NoteMode","textareaStyle","textareaProps","el","jsxs","jsx","styles","singleLineStyle","commonInputProps","createTextPlugin","fontFamilyOptions","DEFAULT_FONT_FAMILY","universalProperties","placeholderDefinition","fontStyleDefinition","multilineDefinition","validationDefinition","Select","TextPlugin"],"mappings":";;;;;;;;;;;;;;;;AAWA,MAAIA,IAAqB,OAAO,IAAI,4BAA4B,GAC9DC,IAAsB,OAAO,IAAI,gBAAgB;AACnD,WAASC,EAAQC,GAAMC,GAAQC,GAAU;AACvC,QAAIC,IAAM;AAGV,QAFWD,MAAX,WAAwBC,IAAM,KAAKD,IACxBD,EAAO,QAAlB,WAA0BE,IAAM,KAAKF,EAAO,MACxC,SAASA,GAAQ;AACnB,MAAAC,IAAW,CAAA;AACX,eAASE,KAAYH;AACnB,QAAUG,MAAV,UAAuBF,EAASE,CAAQ,IAAIH,EAAOG,CAAQ;AAAA,IACjE,MAAS,CAAAF,IAAWD;AAClB,WAAAA,IAASC,EAAS,KACX;AAAA,MACL,UAAUL;AAAA,MACV,MAAMG;AAAA,MACN,KAAKG;AAAA,MACL,KAAgB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"version":3,"file":"TextRenderer.d.ts","sourceRoot":"","sources":["../../src/TextRenderer.tsx"],"names":[],"mappings":"AASA,OAAO,EACN,KAAK,QAAQ,EAEb,KAAK,aAAa,EAGlB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,YAAY,uHA2QvB,CAAC"}
1
+ {"version":3,"file":"TextRenderer.d.ts","sourceRoot":"","sources":["../../src/TextRenderer.tsx"],"names":[],"mappings":"AASA,OAAO,EACN,KAAK,QAAQ,EAGb,KAAK,aAAa,EAGlB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,YAAY,uHAgRvB,CAAC"}
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
- {
2
- "name": "@tatamicks/text",
3
- "version": "0.1.5",
4
- "private": false,
5
- "description": "Text plugin for @tatamicks/core",
6
- "keywords": [
7
- "document-editor",
8
- "plugin",
9
- "text",
10
- "react",
11
- "tatamicks",
12
- "typescript"
13
- ],
14
- "author": "yonpachi",
15
- "license": "MIT",
16
- "repository": {
17
- "type": "git",
18
- "url": "git+https://github.com/torchi-net/tatamicks.git",
19
- "directory": "packages/tatamicks-text"
20
- },
21
- "homepage": "https://github.com/torchi-net/tatamicks#readme",
22
- "bugs": {
23
- "url": "https://github.com/torchi-net/tatamicks/issues"
24
- },
25
- "type": "module",
26
- "main": "dist/index.js",
27
- "module": "dist/index.mjs",
28
- "types": "dist/src/index.d.ts",
29
- "exports": {
30
- ".": {
31
- "types": "./dist/src/index.d.ts",
32
- "import": "./dist/index.mjs",
33
- "require": "./dist/index.js"
34
- }
35
- },
36
- "scripts": {
37
- "build": "vite build .",
38
- "typecheck": "tsc --noEmit",
39
- "test": "vitest --run .",
40
- "test:unit": "vitest --run .",
41
- "lint": "biome check .",
42
- "format": "biome format --write ."
43
- },
44
- "files": [
45
- "dist"
46
- ],
47
- "peerDependencies": {
48
- "@tatamicks/core": "*",
49
- "react": "^19.0.2",
50
- "react-dom": "^19.0.2"
51
- },
52
- "devDependencies": {
53
- "@testing-library/jest-dom": "^6.9.1",
54
- "@testing-library/react": "^16.3.0",
55
- "@testing-library/user-event": "^14.5.2",
56
- "@types/react": "^19.0.2",
57
- "@types/react-dom": "^19.0.2",
58
- "@vitejs/plugin-react": "^4.7.0",
59
- "happy-dom": "^20.3.1",
60
- "react": "^19.0.2",
61
- "react-dom": "^19.0.2",
62
- "typescript": "^5.9.3",
63
- "vite": "^6.3.6",
64
- "vite-plugin-dts": "^4.5.4",
65
- "vite-plugin-lib-inject-css": "^2.2.2",
66
- "vitest": "^3.2.4"
67
- }
68
- }
1
+ {
2
+ "name": "@tatamicks/text",
3
+ "version": "0.1.6",
4
+ "private": false,
5
+ "description": "Text plugin for @tatamicks/core",
6
+ "keywords": [
7
+ "document-editor",
8
+ "plugin",
9
+ "text",
10
+ "react",
11
+ "tatamicks",
12
+ "typescript"
13
+ ],
14
+ "author": "yonpachi",
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/torchi-net/tatamicks.git",
19
+ "directory": "packages/tatamicks-text"
20
+ },
21
+ "homepage": "https://github.com/torchi-net/tatamicks#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/torchi-net/tatamicks/issues"
24
+ },
25
+ "type": "module",
26
+ "main": "dist/index.js",
27
+ "module": "dist/index.mjs",
28
+ "types": "dist/src/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/src/index.d.ts",
32
+ "import": "./dist/index.mjs",
33
+ "require": "./dist/index.js"
34
+ }
35
+ },
36
+ "scripts": {
37
+ "build": "vite build .",
38
+ "typecheck": "tsc --noEmit",
39
+ "test": "vitest --run .",
40
+ "test:unit": "vitest --run .",
41
+ "lint": "biome check .",
42
+ "format": "biome format --write ."
43
+ },
44
+ "files": [
45
+ "dist"
46
+ ],
47
+ "peerDependencies": {
48
+ "@tatamicks/core": "*",
49
+ "react": "^19.0.2",
50
+ "react-dom": "^19.0.2"
51
+ },
52
+ "devDependencies": {
53
+ "@testing-library/jest-dom": "^6.9.1",
54
+ "@testing-library/react": "^16.3.0",
55
+ "@testing-library/user-event": "^14.5.2",
56
+ "@types/react": "^19.0.2",
57
+ "@types/react-dom": "^19.0.2",
58
+ "@vitejs/plugin-react": "^4.7.0",
59
+ "happy-dom": "^20.3.1",
60
+ "react": "^19.0.2",
61
+ "react-dom": "^19.0.2",
62
+ "typescript": "^5.9.3",
63
+ "vite": "^6.3.6",
64
+ "vite-plugin-dts": "^4.5.4",
65
+ "vite-plugin-lib-inject-css": "^2.2.2",
66
+ "vitest": "^3.2.4"
67
+ }
68
+ }