@san-siva/blogkit 1.1.32 → 1.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/CheckList.js +1 -4
- package/dist/cjs/components/CheckList.js.map +1 -1
- package/dist/cjs/dynamicComponents/CheckListDynamic.js +11 -14
- package/dist/cjs/dynamicComponents/CheckListDynamic.js.map +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/esm/components/CheckList.js +1 -4
- package/dist/esm/components/CheckList.js.map +1 -1
- package/dist/esm/dynamicComponents/CheckListDynamic.js +11 -14
- package/dist/esm/dynamicComponents/CheckListDynamic.js.map +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/types/components/CheckList.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/CheckList.tsx +8 -13
- package/src/styles/CheckList.module.scss +2 -2
- package/src/styles/CodeBlock.module.scss +2 -3
- package/src/dynamicComponents/CheckListDynamic.tsx +0 -66
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
4
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
4
|
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var react = require('react');
|
|
8
6
|
var CheckListStatic = require('../staticComponents/CheckListStatic.js');
|
|
9
7
|
|
|
10
|
-
const CheckListDynamic = react.lazy(() => Promise.resolve().then(function () { return require('../dynamicComponents/CheckListDynamic.js'); }));
|
|
11
8
|
const CheckList = ({ items, hasMarginUp = false, hasMarginDown = false, }) => {
|
|
12
|
-
return (jsxRuntime.jsx(
|
|
9
|
+
return (jsxRuntime.jsx(CheckListStatic.default, { items: items, hasMarginUp: hasMarginUp, hasMarginDown: hasMarginDown }));
|
|
13
10
|
};
|
|
14
11
|
|
|
15
12
|
exports.default = CheckList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckList.js","sources":["../../../src/components/CheckList.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"CheckList.js","sources":["../../../src/components/CheckList.tsx"],"sourcesContent":["import CheckListStatic, {\n\ttype CheckListItem,\n} from '../staticComponents/CheckListStatic';\n\ninterface CheckListProperties {\n\titems: CheckListItem[];\n\thasMarginUp?: boolean;\n\thasMarginDown?: boolean;\n}\n\nconst CheckList = ({\n\titems,\n\thasMarginUp = false,\n\thasMarginDown = false,\n}: CheckListProperties) => {\n\treturn (\n\t\t<CheckListStatic\n\t\t\titems={items}\n\t\t\thasMarginUp={hasMarginUp}\n\t\t\thasMarginDown={hasMarginDown}\n\t\t/>\n\t);\n};\n\nexport { type CheckListItem };\nexport default CheckList;\n"],"names":["_jsx","CheckListStatic"],"mappings":";;;;;;;AAUA,MAAM,SAAS,GAAG,CAAC,EAClB,KAAK,EACL,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,KAAK,GACA,KAAI;AACzB,IAAA,QACCA,cAAA,CAACC,uBAAe,EAAA,EACf,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAAA,CAC3B;AAEJ;;;;"}
|
|
@@ -7,24 +7,21 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var CheckList_module = require('../styles/CheckList.module.scss.js');
|
|
9
9
|
|
|
10
|
-
const CHECKBOX_SIZE = 12;
|
|
11
|
-
const P_TAG_FONT_SIZE = 16;
|
|
12
10
|
const CheckListDynamic = ({ items, hasMarginUp = false, hasMarginDown = false, }) => {
|
|
13
11
|
const [checkboxMarginTop, setCheckboxMarginTop] = react.useState(0);
|
|
14
12
|
const measureRef = react.useRef(null);
|
|
15
13
|
react.useEffect(() => {
|
|
16
|
-
if (!measureRef.current)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
14
|
+
// if (!measureRef.current) return;
|
|
15
|
+
// const p = measureRef.current.querySelector('p');
|
|
16
|
+
// if (!p) return;
|
|
17
|
+
// const rawLineHeight = getComputedStyle(p).lineHeight;
|
|
18
|
+
// const lineHeight =
|
|
19
|
+
// rawLineHeight === 'normal'
|
|
20
|
+
// ? P_TAG_FONT_SIZE * 1.2
|
|
21
|
+
// : parseFloat(rawLineHeight);
|
|
22
|
+
// if (!isNaN(lineHeight)) {
|
|
23
|
+
// setCheckboxMarginTop(Math.max(0, (lineHeight - CHECKBOX_SIZE) / 2));
|
|
24
|
+
// }
|
|
28
25
|
}, []);
|
|
29
26
|
return (jsxRuntime.jsx("div", { className: `${CheckList_module.default['check-list']} ${hasMarginUp ? CheckList_module.default['margin-top--1'] : ''} ${hasMarginDown ? CheckList_module.default['margin-bottom--2'] : ''}`, children: items.map((item, index) => (jsxRuntime.jsxs("div", { className: CheckList_module.default['check-list__item'], style: { alignItems: 'flex-start' }, "data-id": item.id, ref: index === 0 ? measureRef : undefined, children: [jsxRuntime.jsx("div", { className: `${CheckList_module.default['check-list__item__input']} ${item.isChecked ? CheckList_module.default['check-list__item__input--checked'] : ''}`, style: { marginTop: `${checkboxMarginTop}px` } }), item.children] }, item.id))) }));
|
|
30
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckListDynamic.js","sources":["../../../src/dynamicComponents/CheckListDynamic.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { CheckListItem } from '../staticComponents/CheckListStatic';\nimport styles from '../styles/CheckList.module.scss';\n\ninterface Properties {\n\titems: CheckListItem[];\n\thasMarginUp?: boolean;\n\thasMarginDown?: boolean;\n}\n\nconst CHECKBOX_SIZE = 12;\nconst P_TAG_FONT_SIZE = 16;\n\nconst CheckListDynamic = ({\n\titems,\n\thasMarginUp = false,\n\thasMarginDown = false,\n}: Properties) => {\n\tconst [checkboxMarginTop, setCheckboxMarginTop] = useState(0);\n\tconst measureRef = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\
|
|
1
|
+
{"version":3,"file":"CheckListDynamic.js","sources":["../../../src/dynamicComponents/CheckListDynamic.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport type { CheckListItem } from '../staticComponents/CheckListStatic';\nimport styles from '../styles/CheckList.module.scss';\n\ninterface Properties {\n\titems: CheckListItem[];\n\thasMarginUp?: boolean;\n\thasMarginDown?: boolean;\n}\n\nconst CHECKBOX_SIZE = 12;\nconst P_TAG_FONT_SIZE = 16;\n\nconst CheckListDynamic = ({\n\titems,\n\thasMarginUp = false,\n\thasMarginDown = false,\n}: Properties) => {\n\tconst [checkboxMarginTop, setCheckboxMarginTop] = useState(0);\n\tconst measureRef = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\t// if (!measureRef.current) return;\n\t\t// const p = measureRef.current.querySelector('p');\n\t\t// if (!p) return;\n\t\t// const rawLineHeight = getComputedStyle(p).lineHeight;\n\t\t// const lineHeight =\n\t\t// \trawLineHeight === 'normal'\n\t\t// \t\t? P_TAG_FONT_SIZE * 1.2\n\t\t// \t\t: parseFloat(rawLineHeight);\n\t\t// if (!isNaN(lineHeight)) {\n\t\t// \tsetCheckboxMarginTop(Math.max(0, (lineHeight - CHECKBOX_SIZE) / 2));\n\t\t// }\n\t}, []);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`${styles['check-list']} ${hasMarginUp ? styles['margin-top--1'] : ''} ${\n\t\t\t\thasMarginDown ? styles['margin-bottom--2'] : ''\n\t\t\t}`}\n\t\t>\n\t\t\t{items.map((item, index) => (\n\t\t\t\t<div\n\t\t\t\t\tkey={item.id}\n\t\t\t\t\tclassName={styles['check-list__item']}\n\t\t\t\t\tstyle={{ alignItems: 'flex-start' }}\n\t\t\t\t\tdata-id={item.id}\n\t\t\t\t\tref={index === 0 ? measureRef : undefined}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={`${styles['check-list__item__input']} ${\n\t\t\t\t\t\t\titem.isChecked ? styles['check-list__item__input--checked'] : ''\n\t\t\t\t\t\t}`}\n\t\t\t\t\t\tstyle={{ marginTop: `${checkboxMarginTop}px` }}\n\t\t\t\t\t/>\n\t\t\t\t\t{item.children}\n\t\t\t\t</div>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nexport default CheckListDynamic;\n"],"names":["useState","useRef","useEffect","_jsx","styles","_jsxs"],"mappings":";;;;;;;;AAgBA,MAAM,gBAAgB,GAAG,CAAC,EACzB,KAAK,EACL,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,KAAK,GACT,KAAI;IAChB,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAGA,cAAQ,CAAC,CAAC,CAAC;AAC7D,IAAA,MAAM,UAAU,GAAGC,YAAM,CAAiB,IAAI,CAAC;IAE/CC,eAAS,CAAC,MAAK;;;;;;;;;;;;IAYf,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,QACCC,cAAA,CAAA,KAAA,EAAA,EACC,SAAS,EAAE,CAAA,EAAGC,wBAAM,CAAC,YAAY,CAAC,CAAA,CAAA,EAAI,WAAW,GAAGA,wBAAM,CAAC,eAAe,CAAC,GAAG,EAAE,CAAA,CAAA,EAC/E,aAAa,GAAGA,wBAAM,CAAC,kBAAkB,CAAC,GAAG,EAC9C,CAAA,CAAE,EAAA,QAAA,EAED,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MACtBC,eAAA,CAAA,KAAA,EAAA,EAEC,SAAS,EAAED,wBAAM,CAAC,kBAAkB,CAAC,EACrC,KAAK,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAA,SAAA,EAC1B,IAAI,CAAC,EAAE,EAChB,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,SAAS,EAAA,QAAA,EAAA,CAEzCD,cAAA,CAAA,KAAA,EAAA,EACC,SAAS,EAAE,CAAA,EAAGC,wBAAM,CAAC,yBAAyB,CAAC,CAAA,CAAA,EAC9C,IAAI,CAAC,SAAS,GAAGA,wBAAM,CAAC,kCAAkC,CAAC,GAAG,EAC/D,CAAA,CAAE,EACF,KAAK,EAAE,EAAE,SAAS,EAAE,GAAG,iBAAiB,CAAA,EAAA,CAAI,EAAE,EAAA,CAC7C,EACD,IAAI,CAAC,QAAQ,CAAA,EAAA,EAZT,IAAI,CAAC,EAAE,CAaP,CACN,CAAC,EAAA,CACG;AAER;;;;"}
|