@takumi-rs/helpers 2.0.0-beta.0 → 2.0.0-beta.10
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/emoji.cjs +1 -1
- package/dist/emoji.d.cts +1 -1
- package/dist/emoji.d.mts +1 -1
- package/dist/emoji.mjs +1 -1
- package/dist/helpers-4kGcvc-Q.cjs +1 -0
- package/dist/helpers-CVQCT1Rh.mjs +1 -0
- package/dist/html.cjs +1 -1
- package/dist/html.d.cts +1 -1
- package/dist/html.d.mts +1 -1
- package/dist/html.mjs +1 -1
- package/dist/index-BZ3ZN0Nn.d.mts +9816 -0
- package/dist/index-dHX8SGUs.d.cts +9816 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -86
- package/dist/index.d.mts +3 -86
- package/dist/index.mjs +1 -1
- package/dist/jsx.cjs +2 -2
- package/dist/jsx.d.cts +2 -1
- package/dist/jsx.d.mts +2 -1
- package/dist/jsx.mjs +2 -2
- package/dist/{markup-R4NoHkwK.mjs → markup-CIGgTVBH.mjs} +2 -2
- package/dist/{markup-DuWo8Fkl.cjs → markup-UWqQuGMA.cjs} +2 -2
- package/dist/{types-DXcFjeZx.d.cts → types-xgX3CGse.d.cts} +1 -0
- package/dist/{types-DXcFjeZx.d.mts → types-xgX3CGse.d.mts} +1 -0
- package/package.json +13 -11
- package/dist/helpers-AzWOnvQd.cjs +0 -1
- package/dist/helpers-CqeNg4sp.mjs +0 -1
package/dist/emoji.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=/\uFE0F/g,n=/\p{Extended_Pictographic}/u,r=/^(?:\p{Regional_Indicator}){2}$/u,i=/^[#*0-9]\uFE0F?\u20E3$/u;function a(e){let n=e.indexOf(``)<0?e.replace(t,``):e,r=``;for(let e=0,t=0;e<n.length;e++){let i=n.charCodeAt(e);if(t){let e=(65536+(t-55296<<10)+(i-56320)).toString(16);r+=(r?`-`:``)+e,t=0}else 55296<=i&&i<=56319?t=i:r+=(r?`-`:``)+i.toString(16)}return r}const o={twemoji:e=>`https://cdn.jsdelivr.net/gh/jdecked/twemoji@17.0.2/assets/svg/${e.toLowerCase()}.svg`,openmoji:`https://cdn.jsdelivr.net/npm/@svgmoji/openmoji@2.0.0/svg/`,blobmoji:`https://cdn.jsdelivr.net/npm/@svgmoji/blob@2.0.0/svg/`,noto:e=>`https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@v2.051/svg/emoji_u${e.toLowerCase().replaceAll(`-`,`_`)}.svg`,fluent:e=>`https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${e.toLowerCase()}_color.svg`,fluentFlat:e=>`https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${e.toLowerCase()}_flat.svg`};function s(e,t){let n=a(e),r=o[t];return typeof r==`function`?r(n):`${r}${n.toUpperCase()}.svg`}let c;function l(){return c===void 0&&(c=typeof Intl<`u`&&typeof Intl.Segmenter==`function`?new Intl.Segmenter(`en`,{granularity:`grapheme`}):null),c}function u(e){let t=l();return t?Array.from(t.segment(e)):Array.from(e).map(e=>({segment:e}))}function d(e){return n.test(e)||r.test(e)||i.test(e)}function f(t,n){let r=[],i=``,a=u(t.text);for(let{segment:t}of a)d(t)?(i&&=(r.push(e.l({text:i})),``),r.push(e.i({src:s(t,n),style:{display:`inline-block`,width:`1em`,height:`1em`,margin:`0 0.05em 0 0.1em`,verticalAlign:`-0.1em`}}))):i+=t;return i&&r.push(e.l({text:i})),r}function p(t,n){if(t.type===`text`){if(u(t.text).some(({segment:e})=>d(e))){let{type:r,...i}=t;return e.t({...i,children:f(t,n)})}}else if(t.type===`container`&&t.children)return{...t,children:t.children.map(e=>e&&p(e,n))};return t}exports.extractEmojis=p;
|
package/dist/emoji.d.cts
CHANGED
package/dist/emoji.d.mts
CHANGED
package/dist/emoji.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,l as t,t as n}from"./helpers-
|
|
1
|
+
import{i as e,l as t,t as n}from"./helpers-CVQCT1Rh.mjs";const r=/\uFE0F/g,i=/\p{Extended_Pictographic}/u,a=/^(?:\p{Regional_Indicator}){2}$/u,o=/^[#*0-9]\uFE0F?\u20E3$/u;function s(e){let t=e.indexOf(``)<0?e.replace(r,``):e,n=``;for(let e=0,r=0;e<t.length;e++){let i=t.charCodeAt(e);if(r){let e=(65536+(r-55296<<10)+(i-56320)).toString(16);n+=(n?`-`:``)+e,r=0}else 55296<=i&&i<=56319?r=i:n+=(n?`-`:``)+i.toString(16)}return n}const c={twemoji:e=>`https://cdn.jsdelivr.net/gh/jdecked/twemoji@17.0.2/assets/svg/${e.toLowerCase()}.svg`,openmoji:`https://cdn.jsdelivr.net/npm/@svgmoji/openmoji@2.0.0/svg/`,blobmoji:`https://cdn.jsdelivr.net/npm/@svgmoji/blob@2.0.0/svg/`,noto:e=>`https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@v2.051/svg/emoji_u${e.toLowerCase().replaceAll(`-`,`_`)}.svg`,fluent:e=>`https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${e.toLowerCase()}_color.svg`,fluentFlat:e=>`https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${e.toLowerCase()}_flat.svg`};function l(e,t){let n=s(e),r=c[t];return typeof r==`function`?r(n):`${r}${n.toUpperCase()}.svg`}let u;function d(){return u===void 0&&(u=typeof Intl<`u`&&typeof Intl.Segmenter==`function`?new Intl.Segmenter(`en`,{granularity:`grapheme`}):null),u}function f(e){let t=d();return t?Array.from(t.segment(e)):Array.from(e).map(e=>({segment:e}))}function p(e){return i.test(e)||a.test(e)||o.test(e)}function m(n,r){let i=[],a=``,o=f(n.text);for(let{segment:n}of o)p(n)?(a&&=(i.push(t({text:a})),``),i.push(e({src:l(n,r),style:{display:`inline-block`,width:`1em`,height:`1em`,margin:`0 0.05em 0 0.1em`,verticalAlign:`-0.1em`}}))):a+=n;return a&&i.push(t({text:a})),i}function h(e,t){if(e.type===`text`){if(f(e.text).some(({segment:e})=>p(e))){let{type:r,...i}=e;return n({...i,children:m(e,t)})}}else if(e.type===`container`&&e.children)return{...e,children:e.children.map(e=>e&&h(e,t))};return e}export{h as extractEmojis};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){t&&Object.keys(t).length>0&&(e.style=t)}function t(e,t){t&&Object.keys(t).length>0&&(e.preset=t)}function n(e,t){t.tagName!==void 0&&(e.tagName=t.tagName),t.className!==void 0&&(e.className=t.className),t.id!==void 0&&(e.id=t.id),t.dir!==void 0&&(e.dir=t.dir),t.lang!==void 0&&(e.lang=t.lang),t.attributes!==void 0&&(e.attributes=t.attributes)}function r(r){let i={type:`container`,children:r.children};return r.tw&&(i.tw=r.tw),n(i,r),t(i,r.preset),e(i,r.style),i}function i(r,i){if(typeof r==`string`){let t={type:`text`,text:r};return e(t,i),t}let a={type:`text`,text:r.text};return r.tw&&(a.tw=r.tw),n(a,r),t(a,r.preset),e(a,i??r.style),a}function a(r){let i={type:`image`,src:r.src,width:r.width,height:r.height};return r.tw&&(i.tw=r.tw),n(i,r),t(i,r.preset),e(i,r.style),i}function o(e){return e}function s(e){return`${e}%`}function c(e){return`${e}vw`}function l(e){return`${e}vh`}function u(e){return`${e}em`}function d(e){return`${e}rem`}function f(e){return`${e}fr`}function p(e,t,n,r=1){return`rgb(${e} ${t} ${n} / ${r})`}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return l}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t){t&&Object.keys(t).length>0&&(e.style=t)}function t(e,t){t&&Object.keys(t).length>0&&(e.preset=t)}function n(e,t){t.tagName!==void 0&&(e.tagName=t.tagName),t.className!==void 0&&(e.className=t.className),t.id!==void 0&&(e.id=t.id),t.dir!==void 0&&(e.dir=t.dir),t.lang!==void 0&&(e.lang=t.lang),t.attributes!==void 0&&(e.attributes=t.attributes)}function r(r){let i={type:`container`,children:r.children};return r.tw&&(i.tw=r.tw),n(i,r),t(i,r.preset),e(i,r.style),i}function i(r,i){if(typeof r==`string`){let t={type:`text`,text:r};return e(t,i),t}let a={type:`text`,text:r.text};return r.tw&&(a.tw=r.tw),n(a,r),t(a,r.preset),e(a,i??r.style),a}function a(r){let i={type:`image`,src:r.src,width:r.width,height:r.height};return r.tw&&(i.tw=r.tw),n(i,r),t(i,r.preset),e(i,r.style),i}function o(e){return e}function s(e){return`${e}%`}function c(e){return`${e}vw`}function l(e){return`${e}vh`}function u(e){return`${e}em`}function d(e){return`${e}rem`}function f(e){return`${e}fr`}function p(e,t,n,r=1){return`rgb(${e} ${t} ${n} / ${r})`}export{s as a,o as c,c as d,a as i,i as l,u as n,d as o,f as r,p as s,r as t,l as u};
|
package/dist/html.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./helpers-4kGcvc-Q.cjs"),t=require("./markup-UWqQuGMA.cjs");function n(n){let{nodes:r,stylesheets:i}=t.t(n);return r.length===0?{node:e.t({}),stylesheets:i}:r.length===1&&r[0]?{node:r[0],stylesheets:i}:{node:e.t({style:{width:e.a(100),height:e.a(100)},children:r}),stylesheets:i}}exports.fromHtml=n;
|
package/dist/html.d.cts
CHANGED
package/dist/html.d.mts
CHANGED
package/dist/html.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,t}from"./helpers-
|
|
1
|
+
import{a as e,t}from"./helpers-CVQCT1Rh.mjs";import{t as n}from"./markup-CIGgTVBH.mjs";function r(r){let{nodes:i,stylesheets:a}=n(r);return i.length===0?{node:t({}),stylesheets:a}:i.length===1&&i[0]?{node:i[0],stylesheets:a}:{node:t({style:{width:e(100),height:e(100)},children:i}),stylesheets:a}}export{r as fromHtml};
|