@jackuait/blok 0.7.3 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blok.mjs +2 -2
- package/dist/chunks/{blok-BmlbETK7.mjs → blok-Ddy2vDUq.mjs} +2158 -2147
- package/dist/chunks/{constants-WhLyFkza.mjs → constants-CuG2mgIj.mjs} +84 -84
- package/dist/chunks/{i18next-loader-CZARkla1.mjs → i18next-loader-p-7ioTwr.mjs} +1 -1
- package/dist/chunks/{lightweight-i18n-BQa0F2X6.mjs → lightweight-i18n-BPeH69Dl.mjs} +5 -1
- package/dist/{messages-BbLCMWln2.mjs → chunks/messages--aM83pib2.mjs} +14 -1
- package/dist/chunks/{messages-ni0ahgYk2.mjs → messages-4OvVdaG52.mjs} +14 -1
- package/dist/chunks/{messages-DnPkoMz1.mjs → messages-5ohIWynJ.mjs} +14 -1
- package/dist/{messages-CzSLUJQt.mjs → chunks/messages-5thhSeME.mjs} +14 -1
- package/dist/chunks/{messages-hngFJrES2.mjs → messages-8pf7gRQm2.mjs} +14 -1
- package/dist/chunks/{messages-DcPtg90i.mjs → messages-B-i-d1Bc.mjs} +14 -1
- package/dist/chunks/{messages-CRxkRJRN.mjs → messages-B9zocutJ.mjs} +14 -1
- package/dist/chunks/{messages-BUy3odZo.mjs → messages-BAC7nLeM.mjs} +14 -1
- package/dist/chunks/{messages-DjOY_EqX.mjs → messages-BARPMN7R.mjs} +14 -1
- package/dist/{messages-Bsz7Qgj_.mjs → chunks/messages-BAgTIgPH.mjs} +15 -2
- package/dist/{messages-C7R0m6oE2.mjs → chunks/messages-BDTgiBJY2.mjs} +14 -1
- package/dist/chunks/{messages-BM1Su_Uy2.mjs → messages-BHf_VcXb2.mjs} +14 -1
- package/dist/{messages-wRvz0vQ3.mjs → chunks/messages-BIrkzbBP.mjs} +14 -1
- package/dist/chunks/{messages-DotEkUpQ.mjs → messages-BKjLgO5d.mjs} +14 -1
- package/dist/{messages-gldjQk7M.mjs → chunks/messages-BMzmli1K.mjs} +14 -1
- package/dist/chunks/{messages-CficsmSH2.mjs → messages-BO_jtRbZ2.mjs} +14 -1
- package/dist/{messages-B2bHgIcC2.mjs → chunks/messages-B_fFjpX12.mjs} +14 -1
- package/dist/chunks/{messages-CnzaTbel.mjs → messages-Bdk5tBNu.mjs} +14 -1
- package/dist/{messages-CRMZ79Xf.mjs → chunks/messages-BgaGPFuy2.mjs} +14 -1
- package/dist/{messages-DCOKudVN.mjs → chunks/messages-BsYzg2le.mjs} +14 -1
- package/dist/chunks/{messages-Dxrg70jo.mjs → messages-BtS6JWMT.mjs} +14 -1
- package/dist/{messages-Cgy54529.mjs → chunks/messages-BvlSf_pu.mjs} +14 -1
- package/dist/{messages-oH0ADQ362.mjs → chunks/messages-C03I_oR-2.mjs} +14 -1
- package/dist/chunks/{messages-B_nVGWdk.mjs → messages-CDJLoStb.mjs} +14 -1
- package/dist/chunks/{messages-ClOxDE0y2.mjs → messages-CH_cexo62.mjs} +14 -1
- package/dist/chunks/{messages-DoDbCS02.mjs → messages-CIBuZccC.mjs} +14 -1
- package/dist/{messages-CkmVEyEQ2.mjs → chunks/messages-CIZkNCpW.mjs} +14 -1
- package/dist/{messages-CJYE0_hr2.mjs → chunks/messages-CIugNDDO2.mjs} +14 -1
- package/dist/{messages-DpY9s4Qi2.mjs → chunks/messages-COkQfKa72.mjs} +14 -1
- package/dist/{messages-Bw-GC0m5.mjs → chunks/messages-CSpfBhlK2.mjs} +14 -1
- package/dist/chunks/{messages-tBHnC2Rj2.mjs → messages-CWp6-Y8f2.mjs} +14 -1
- package/dist/{messages-GrVSCmXW.mjs → chunks/messages-Co4WFeQ8.mjs} +14 -1
- package/dist/{messages-voUPclMU.mjs → chunks/messages-CoRQE_Jc.mjs} +14 -1
- package/dist/{messages-DGZQXeav2.mjs → chunks/messages-CuRN1_ep2.mjs} +14 -1
- package/dist/{messages-BwdowdYD.mjs → chunks/messages-D0IKicWg.mjs} +14 -1
- package/dist/chunks/{messages-1C3OS98e.mjs → messages-D14soBOO.mjs} +14 -1
- package/dist/chunks/{messages-nE9Ko73n2.mjs → messages-D1SqLcxI2.mjs} +14 -1
- package/dist/{messages-COU4L-pL2.mjs → chunks/messages-D2uBlGXR2.mjs} +14 -1
- package/dist/{messages-m1uf_AMy2.mjs → chunks/messages-DDpgr0B1.mjs} +14 -1
- package/dist/{messages-CB0RKGVM.mjs → chunks/messages-DEGzGmEQ2.mjs} +14 -1
- package/dist/{messages--XEfVx572.mjs → chunks/messages-DKChC8Qu.mjs} +14 -1
- package/dist/{messages-BP8ZuVaD.mjs → chunks/messages-DKCoHa5D.mjs} +14 -1
- package/dist/chunks/{messages-C3AJz_i6.mjs → messages-DPoPrTiZ.mjs} +14 -1
- package/dist/{messages-CaJRIGUu2.mjs → chunks/messages-DQOk-dTH.mjs} +14 -1
- package/dist/chunks/{messages-uLIUXFmU.mjs → messages-DUp8NnKT.mjs} +15 -2
- package/dist/chunks/{messages-rJdSnvyi.mjs → messages-DVg69mRj.mjs} +14 -1
- package/dist/chunks/{messages-Cq6wj6FG.mjs → messages-DeLzropc.mjs} +14 -1
- package/dist/{messages-BlnZ8CkJ2.mjs → chunks/messages-Df69rfTF2.mjs} +15 -2
- package/dist/{messages-BZgGD0zf2.mjs → chunks/messages-DfsHFEWa.mjs} +14 -1
- package/dist/chunks/{messages-yJmwc3zD.mjs → messages-DgZnRQRS.mjs} +14 -1
- package/dist/chunks/{messages-m6bLP64R2.mjs → messages-DhGHk-Ma2.mjs} +14 -1
- package/dist/{messages-3aRjZXpv.mjs → chunks/messages-Di7mfvB8.mjs} +14 -1
- package/dist/chunks/{messages-C1iQkKu82.mjs → messages-DlM9TmqS2.mjs} +14 -1
- package/dist/chunks/{messages-CejEH4FW2.mjs → messages-DmrsEYQm2.mjs} +14 -1
- package/dist/chunks/{messages-DK6pBwD2.mjs → messages-Dr-Ig3sw.mjs} +14 -1
- package/dist/{messages-BOxe7ewT.mjs → chunks/messages-DrXNb1gu.mjs} +14 -1
- package/dist/chunks/{messages-CvLXClh9.mjs → messages-EDTq4Q52.mjs} +14 -1
- package/dist/{messages-huTzItxA.mjs → chunks/messages-Ehx9YYeb2.mjs} +14 -1
- package/dist/chunks/{messages-CxTq0x772.mjs → messages-FCmAVA792.mjs} +14 -1
- package/dist/{messages-q7HzQPVt.mjs → chunks/messages-LL3Tflph.mjs} +14 -1
- package/dist/chunks/{messages-D9qyilS0.mjs → messages-N72K1hw3.mjs} +14 -1
- package/dist/chunks/{messages-C9XSSqS5.mjs → messages-Nz8C7Znm.mjs} +15 -2
- package/dist/chunks/{messages-D6SAC8Lc2.mjs → messages-OIelQDL32.mjs} +14 -1
- package/dist/{messages-BQJzUYP-.mjs → chunks/messages-SsrFJhTN.mjs} +14 -1
- package/dist/{messages-CVBsztOg.mjs → chunks/messages-ohtcmr1w.mjs} +14 -1
- package/dist/chunks/{messages-CVzvKl6U.mjs → messages-stUQR58d.mjs} +14 -1
- package/dist/{messages-DlrZrm3s.mjs → chunks/messages-wUoSWFsJ2.mjs} +14 -1
- package/dist/chunks/{tools-BCb5bMO3.mjs → tools-F4UyWgGo.mjs} +1086 -802
- package/dist/full.mjs +15 -13
- package/dist/locales.mjs +72 -68
- package/dist/{messages-mVFAkdcY.mjs → messages-1_FCq0It.mjs} +14 -1
- package/dist/{messages-DkkrjINb2.mjs → messages-8zo-T-Nx2.mjs} +14 -1
- package/dist/{chunks/messages-DacahKek.mjs → messages-B21zLG6b.mjs} +14 -1
- package/dist/{messages-BBgyeB_N.mjs → messages-B9ythxux.mjs} +14 -1
- package/dist/{messages-C_RPN2GV.mjs → messages-BAZK-8Zb.mjs} +14 -1
- package/dist/{messages-D6Sr5cUE.mjs → messages-BB8umWL1.mjs} +14 -1
- package/dist/{chunks/messages-Dhe8_mnQ.mjs → messages-BD_U2EnE.mjs} +14 -1
- package/dist/{messages-6G0Eia-2.mjs → messages-BRC9E_sp.mjs} +14 -1
- package/dist/{messages-pgqtPci-.mjs → messages-BSLYh59S.mjs} +14 -1
- package/dist/{messages-K7ROT6ea.mjs → messages-BSwhWcYw.mjs} +14 -1
- package/dist/{messages-BztXgybv2.mjs → messages-BTR3QlIb2.mjs} +14 -1
- package/dist/{messages-C0gyqo4h2.mjs → messages-BZXBdD_S2.mjs} +14 -1
- package/dist/{chunks/messages-DDRCk44J2.mjs → messages-Bm8I_Li12.mjs} +15 -2
- package/dist/{chunks/messages-BKtWlK39.mjs → messages-BrcgNZOJ.mjs} +14 -1
- package/dist/{messages-Be1CCcsp2.mjs → messages-BzZ8LahA2.mjs} +14 -1
- package/dist/{chunks/messages-B_90PYaG.mjs → messages-C4HpNHfK.mjs} +14 -1
- package/dist/{messages-B8M4YRFO2.mjs → messages-C5hD5pSd2.mjs} +14 -1
- package/dist/{messages-ruU_e2LK.mjs → messages-C7Rz00Tp.mjs} +14 -1
- package/dist/{chunks/messages-C1lqY56F2.mjs → messages-C92tAUYT2.mjs} +14 -1
- package/dist/{messages-Kye1BINC.mjs → messages-C9LsEUfG.mjs} +14 -1
- package/dist/{chunks/messages-tg78NAmW.mjs → messages-CHWfj4ik.mjs} +14 -1
- package/dist/{chunks/messages-DziA-L3p.mjs → messages-CHeucLGl2.mjs} +14 -1
- package/dist/{messages-eCyczLYY.mjs → messages-CIxT1nSh.mjs} +14 -1
- package/dist/{chunks/messages-Cb-x47kY2.mjs → messages-CKX9iXIb2.mjs} +14 -1
- package/dist/{chunks/messages-BjkDJuqh.mjs → messages-CKmmJ9tW.mjs} +14 -1
- package/dist/{chunks/messages-Cn5n0nHe2.mjs → messages-CTFwu5-h2.mjs} +14 -1
- package/dist/{messages-DAssrN5L2.mjs → messages-CTPFrtK92.mjs} +14 -1
- package/dist/{chunks/messages-6EJxSImH.mjs → messages-CWzET_9H2.mjs} +14 -1
- package/dist/{chunks/messages-BZ45xBlV.mjs → messages-CkIRmpfZ2.mjs} +14 -1
- package/dist/{chunks/messages-kHTrX3wo2.mjs → messages-CmoTIebG2.mjs} +14 -1
- package/dist/{messages-DZbsds_k2.mjs → messages-Co26RSCV2.mjs} +14 -1
- package/dist/{messages-DrouoDgp.mjs → messages-CqNzlpWi.mjs} +15 -2
- package/dist/{chunks/messages-DDr8J4FE.mjs → messages-CrWsU4Xw2.mjs} +14 -1
- package/dist/{messages-TseLyyoU.mjs → messages-CsmTziC6.mjs} +14 -1
- package/dist/{messages-CAffVeAE2.mjs → messages-CsnglxbV2.mjs} +14 -1
- package/dist/{messages-CE305J0p.mjs → messages-Cu7Lr1wp.mjs} +14 -1
- package/dist/{chunks/messages-Ul43l29K2.mjs → messages-Cy3Ne_M9.mjs} +14 -1
- package/dist/{chunks/messages-CzCqu58X2.mjs → messages-CzZAfGif.mjs} +14 -1
- package/dist/{messages-C_4VGaBC.mjs → messages-D5rnT-BC.mjs} +14 -1
- package/dist/{messages-MaHxNgKA.mjs → messages-D8iCBMg7.mjs} +14 -1
- package/dist/{chunks/messages-BtNOlsMj.mjs → messages-DDJOu049.mjs} +14 -1
- package/dist/{messages-BU9luYgO.mjs → messages-DDiP6yex.mjs} +14 -1
- package/dist/{messages-DB9U3VIh.mjs → messages-DHJ1fZLL.mjs} +14 -1
- package/dist/{chunks/messages-3ePgbbpx2.mjs → messages-DToWAonn2.mjs} +14 -1
- package/dist/{messages-BxQ1gzJF2.mjs → messages-DV29fJMD2.mjs} +14 -1
- package/dist/{chunks/messages-DJWRON2S.mjs → messages-D_-rh8gl.mjs} +14 -1
- package/dist/{messages-e-KHuxtY2.mjs → messages-D_cAZ4Ic2.mjs} +14 -1
- package/dist/{chunks/messages-pKUiAqlX2.mjs → messages-Dc7ZzqYN.mjs} +14 -1
- package/dist/{chunks/messages-JRavIeeW.mjs → messages-DiSeSE8p.mjs} +14 -1
- package/dist/{chunks/messages-DbS9Oibb.mjs → messages-Djhu5RJd.mjs} +14 -1
- package/dist/{messages-BdJ1lCo_.mjs → messages-Dr9L1psl.mjs} +15 -2
- package/dist/{chunks/messages-IJhiftj5.mjs → messages-EIeWKoc5.mjs} +14 -1
- package/dist/{chunks/messages-CteKp81J.mjs → messages-EwoT2jof.mjs} +14 -1
- package/dist/{messages-C8iAUPzI.mjs → messages-F7cRf-20.mjs} +14 -1
- package/dist/{messages-B9qltgXa.mjs → messages-JZhs_0pf.mjs} +14 -1
- package/dist/{chunks/messages-C232njMF2.mjs → messages-JwMkLben.mjs} +14 -1
- package/dist/{messages-Cb5JJ8C_2.mjs → messages-LyzjEEIj2.mjs} +14 -1
- package/dist/{chunks/messages-DQ4VyVJf2.mjs → messages-SepwOOcg.mjs} +14 -1
- package/dist/{chunks/messages-DfTU2I8J.mjs → messages-TI0u6Ked.mjs} +14 -1
- package/dist/{chunks/messages-D7aoKTPD.mjs → messages-Tx25QErT.mjs} +14 -1
- package/dist/{chunks/messages-D9nReG4C2.mjs → messages-bRqMCja-2.mjs} +14 -1
- package/dist/{chunks/messages-h474TGR72.mjs → messages-lEyiemqU2.mjs} +14 -1
- package/dist/{messages-BENRci-_2.mjs → messages-mVLfVtQX2.mjs} +14 -1
- package/dist/{messages-CEhkWwqI.mjs → messages-ouO9js8Z.mjs} +14 -1
- package/dist/{chunks/messages-6z-ULVyk.mjs → messages-ouRGTAKo2.mjs} +14 -1
- package/dist/{chunks/messages-DNrK8lCg2.mjs → messages-qV14y_oA2.mjs} +14 -1
- package/dist/{chunks/messages-Yk__PXZQ.mjs → messages-rM6YFLZH.mjs} +15 -2
- package/dist/react.mjs +2 -2
- package/dist/tools.mjs +3 -3
- package/package.json +1 -1
- package/src/components/i18n/locales/am/messages.json +14 -1
- package/src/components/i18n/locales/ar/messages.json +14 -1
- package/src/components/i18n/locales/az/messages.json +14 -1
- package/src/components/i18n/locales/bg/messages.json +15 -2
- package/src/components/i18n/locales/bn/messages.json +14 -1
- package/src/components/i18n/locales/bs/messages.json +14 -1
- package/src/components/i18n/locales/cs/messages.json +14 -1
- package/src/components/i18n/locales/da/messages.json +14 -1
- package/src/components/i18n/locales/de/messages.json +14 -1
- package/src/components/i18n/locales/dv/messages.json +14 -1
- package/src/components/i18n/locales/el/messages.json +14 -1
- package/src/components/i18n/locales/en/messages.json +5 -1
- package/src/components/i18n/locales/es/messages.json +14 -1
- package/src/components/i18n/locales/et/messages.json +15 -2
- package/src/components/i18n/locales/fa/messages.json +14 -1
- package/src/components/i18n/locales/fi/messages.json +14 -1
- package/src/components/i18n/locales/fil/messages.json +14 -1
- package/src/components/i18n/locales/fr/messages.json +14 -1
- package/src/components/i18n/locales/gu/messages.json +14 -1
- package/src/components/i18n/locales/he/messages.json +14 -1
- package/src/components/i18n/locales/hi/messages.json +14 -1
- package/src/components/i18n/locales/hr/messages.json +14 -1
- package/src/components/i18n/locales/hu/messages.json +14 -1
- package/src/components/i18n/locales/hy/messages.json +14 -1
- package/src/components/i18n/locales/id/messages.json +14 -1
- package/src/components/i18n/locales/it/messages.json +14 -1
- package/src/components/i18n/locales/ja/messages.json +14 -1
- package/src/components/i18n/locales/ka/messages.json +14 -1
- package/src/components/i18n/locales/km/messages.json +14 -1
- package/src/components/i18n/locales/kn/messages.json +14 -1
- package/src/components/i18n/locales/ko/messages.json +14 -1
- package/src/components/i18n/locales/ku/messages.json +14 -1
- package/src/components/i18n/locales/lo/messages.json +14 -1
- package/src/components/i18n/locales/lt/messages.json +14 -1
- package/src/components/i18n/locales/lv/messages.json +14 -1
- package/src/components/i18n/locales/mk/messages.json +14 -1
- package/src/components/i18n/locales/ml/messages.json +14 -1
- package/src/components/i18n/locales/mn/messages.json +14 -1
- package/src/components/i18n/locales/mr/messages.json +14 -1
- package/src/components/i18n/locales/ms/messages.json +14 -1
- package/src/components/i18n/locales/my/messages.json +14 -1
- package/src/components/i18n/locales/ne/messages.json +14 -1
- package/src/components/i18n/locales/nl/messages.json +14 -1
- package/src/components/i18n/locales/no/messages.json +14 -1
- package/src/components/i18n/locales/pa/messages.json +14 -1
- package/src/components/i18n/locales/pl/messages.json +14 -1
- package/src/components/i18n/locales/ps/messages.json +14 -1
- package/src/components/i18n/locales/pt/messages.json +14 -1
- package/src/components/i18n/locales/ro/messages.json +14 -1
- package/src/components/i18n/locales/ru/messages.json +15 -2
- package/src/components/i18n/locales/sd/messages.json +14 -1
- package/src/components/i18n/locales/si/messages.json +14 -1
- package/src/components/i18n/locales/sk/messages.json +14 -1
- package/src/components/i18n/locales/sl/messages.json +14 -1
- package/src/components/i18n/locales/sq/messages.json +14 -1
- package/src/components/i18n/locales/sr/messages.json +14 -1
- package/src/components/i18n/locales/sv/messages.json +14 -1
- package/src/components/i18n/locales/sw/messages.json +14 -1
- package/src/components/i18n/locales/ta/messages.json +14 -1
- package/src/components/i18n/locales/te/messages.json +14 -1
- package/src/components/i18n/locales/th/messages.json +14 -1
- package/src/components/i18n/locales/tr/messages.json +14 -1
- package/src/components/i18n/locales/ug/messages.json +14 -1
- package/src/components/i18n/locales/uk/messages.json +15 -2
- package/src/components/i18n/locales/ur/messages.json +14 -1
- package/src/components/i18n/locales/vi/messages.json +14 -1
- package/src/components/i18n/locales/yi/messages.json +14 -1
- package/src/components/i18n/locales/zh/messages.json +14 -1
- package/src/components/icons/index.ts +18 -0
- package/src/components/inline-tools/inline-tool-strikethrough.ts +408 -0
- package/src/components/inline-tools/inline-tool-underline.ts +408 -0
- package/src/components/modules/paste/handlers/base.ts +14 -4
- package/src/components/modules/rectangleSelection.ts +48 -0
- package/src/components/modules/toolbar/index.ts +5 -2
- package/src/components/modules/toolbar/inline/shortcuts-manager.ts +4 -3
- package/src/components/shared/color-picker.ts +10 -2
- package/src/full.ts +7 -1
- package/src/stories/MarkerColors.stories.ts +13 -34
- package/src/styles/main.css +1 -1
- package/src/tools/header/index.ts +6 -4
- package/src/tools/index.ts +4 -0
- package/src/tools/list/constants.ts +3 -3
- package/src/tools/list/dom-builder.ts +1 -0
- package/src/tools/table/table-cell-blocks.ts +25 -0
- package/src/tools/toggle/constants.ts +12 -5
|
@@ -93,8 +93,8 @@ const INLINE_TOOLBAR_TESTID = '[data-blok-testid="inline-toolbar"]';
|
|
|
93
93
|
const CONTENTEDITABLE_SELECTOR = '[contenteditable="true"]';
|
|
94
94
|
const MARKER_TOOL_SELECTOR = '[data-blok-item-name="marker"]';
|
|
95
95
|
const MARKER_PICKER_SELECTOR = '[data-blok-testid="marker-picker"]';
|
|
96
|
-
const
|
|
97
|
-
const
|
|
96
|
+
const MARKER_COLOR_SECTION_SELECTOR = '[data-blok-testid="marker-section-color"] button';
|
|
97
|
+
const MARKER_BG_SECTION_SELECTOR = '[data-blok-testid="marker-section-background-color"] button';
|
|
98
98
|
const TIMEOUT_INIT = { timeout: 5000 };
|
|
99
99
|
const TIMEOUT_ACTION = { timeout: 5000 };
|
|
100
100
|
|
|
@@ -411,8 +411,7 @@ export const PickerTextTab: Story = {
|
|
|
411
411
|
|
|
412
412
|
await waitFor(
|
|
413
413
|
() => {
|
|
414
|
-
const
|
|
415
|
-
const swatches = grid?.querySelectorAll('button');
|
|
414
|
+
const swatches = document.querySelectorAll(MARKER_COLOR_SECTION_SELECTOR);
|
|
416
415
|
|
|
417
416
|
expect(swatches?.length).toBe(10);
|
|
418
417
|
},
|
|
@@ -434,24 +433,14 @@ export const PickerBackgroundTab: Story = {
|
|
|
434
433
|
chromatic: { delay: 500 },
|
|
435
434
|
},
|
|
436
435
|
play: async ({ canvasElement, step }) => {
|
|
437
|
-
await step('Open marker picker', async () => {
|
|
436
|
+
await step('Open marker picker and verify background section', async () => {
|
|
438
437
|
await openMarkerPicker(canvasElement);
|
|
439
|
-
});
|
|
440
|
-
|
|
441
|
-
await step('Switch to background tab', async () => {
|
|
442
|
-
const bgTab = document.querySelector(MARKER_TAB_BG_SELECTOR);
|
|
443
|
-
|
|
444
|
-
expect(bgTab).toBeInTheDocument();
|
|
445
|
-
|
|
446
|
-
if (bgTab) {
|
|
447
|
-
simulateClick(bgTab);
|
|
448
|
-
}
|
|
449
438
|
|
|
450
439
|
await waitFor(
|
|
451
440
|
() => {
|
|
452
|
-
const
|
|
441
|
+
const swatches = document.querySelectorAll(MARKER_BG_SECTION_SELECTOR);
|
|
453
442
|
|
|
454
|
-
expect(
|
|
443
|
+
expect(swatches?.length).toBe(10);
|
|
455
444
|
},
|
|
456
445
|
TIMEOUT_ACTION
|
|
457
446
|
);
|
|
@@ -475,7 +464,7 @@ export const PickerDefaultButton: Story = {
|
|
|
475
464
|
|
|
476
465
|
await waitFor(
|
|
477
466
|
() => {
|
|
478
|
-
const defaultBtn = document.querySelector('[data-blok-testid="marker-default
|
|
467
|
+
const defaultBtn = document.querySelector('[data-blok-testid="marker-swatch-color-default"]');
|
|
479
468
|
|
|
480
469
|
expect(defaultBtn).toBeInTheDocument();
|
|
481
470
|
},
|
|
@@ -502,13 +491,12 @@ export const PickerNoActiveSwatch: Story = {
|
|
|
502
491
|
|
|
503
492
|
await waitFor(
|
|
504
493
|
() => {
|
|
505
|
-
const
|
|
506
|
-
const swatches = grid?.querySelectorAll('button');
|
|
494
|
+
const swatches = document.querySelectorAll(MARKER_COLOR_SECTION_SELECTOR);
|
|
507
495
|
|
|
508
496
|
expect(swatches?.length).toBe(10);
|
|
509
497
|
|
|
510
498
|
swatches?.forEach((swatch) => {
|
|
511
|
-
expect(swatch.className).not.toContain('ring-
|
|
499
|
+
expect(swatch.className).not.toContain('ring-swatch-ring-hover');
|
|
512
500
|
});
|
|
513
501
|
},
|
|
514
502
|
TIMEOUT_ACTION
|
|
@@ -581,9 +569,9 @@ export const PickerActiveTextSwatch: Story = {
|
|
|
581
569
|
// Verify the red swatch has the active ring
|
|
582
570
|
await waitFor(
|
|
583
571
|
() => {
|
|
584
|
-
const redSwatch = document.querySelector('[data-blok-testid="marker-swatch-red"]');
|
|
572
|
+
const redSwatch = document.querySelector('[data-blok-testid="marker-swatch-color-red"]');
|
|
585
573
|
|
|
586
|
-
expect(redSwatch?.className).toContain('ring-
|
|
574
|
+
expect(redSwatch?.className).toContain('ring-swatch-ring-hover');
|
|
587
575
|
},
|
|
588
576
|
TIMEOUT_ACTION
|
|
589
577
|
);
|
|
@@ -653,21 +641,12 @@ export const PickerActiveBackgroundSwatch: Story = {
|
|
|
653
641
|
TIMEOUT_ACTION
|
|
654
642
|
);
|
|
655
643
|
|
|
656
|
-
// Switch to background tab
|
|
657
|
-
const bgTab = document.querySelector(MARKER_TAB_BG_SELECTOR);
|
|
658
|
-
|
|
659
|
-
expect(bgTab).toBeInTheDocument();
|
|
660
|
-
|
|
661
|
-
if (bgTab) {
|
|
662
|
-
simulateClick(bgTab);
|
|
663
|
-
}
|
|
664
|
-
|
|
665
644
|
// Verify the orange swatch has the active ring
|
|
666
645
|
await waitFor(
|
|
667
646
|
() => {
|
|
668
|
-
const orangeSwatch = document.querySelector('[data-blok-testid="marker-swatch-orange"]');
|
|
647
|
+
const orangeSwatch = document.querySelector('[data-blok-testid="marker-swatch-background-color-orange"]');
|
|
669
648
|
|
|
670
|
-
expect(orangeSwatch?.className).toContain('ring-
|
|
649
|
+
expect(orangeSwatch?.className).toContain('ring-swatch-ring-hover');
|
|
671
650
|
},
|
|
672
651
|
TIMEOUT_ACTION
|
|
673
652
|
);
|
package/src/styles/main.css
CHANGED
|
@@ -1041,7 +1041,7 @@
|
|
|
1041
1041
|
*/
|
|
1042
1042
|
@utility blok-block {
|
|
1043
1043
|
/* Base Blok styles - applied to block tool wrappers */
|
|
1044
|
-
@apply py-[
|
|
1044
|
+
@apply py-[7px] px-[2px] [&::-webkit-input-placeholder]:leading-normal!;
|
|
1045
1045
|
}
|
|
1046
1046
|
@utility blok-inline-tool-button {
|
|
1047
1047
|
/* Inline Tools styles */
|
|
@@ -21,7 +21,7 @@ import { DATA_ATTR } from '../../components/constants';
|
|
|
21
21
|
import { IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconToggleH1, IconToggleH2, IconToggleH3 } from '../../components/icons';
|
|
22
22
|
import { PLACEHOLDER_CLASSES, setupPlaceholder } from '../../components/utils/placeholder';
|
|
23
23
|
import { twMerge } from '../../components/utils/tw';
|
|
24
|
-
import { BODY_PLACEHOLDER_STYLES, TOGGLE_ATTR
|
|
24
|
+
import { BODY_PLACEHOLDER_STYLES, TOGGLE_ATTR } from '../toggle/constants';
|
|
25
25
|
import { buildArrow } from '../toggle/dom-builder';
|
|
26
26
|
import { updateArrowState, updateBodyPlaceholderVisibility, updateChildrenVisibility } from '../toggle/toggle-lifecycle';
|
|
27
27
|
import { handleHeaderToggleEnter, handleHeaderToggleBackspace } from './header-toggle-keyboard';
|
|
@@ -198,7 +198,7 @@ export class Header implements BlockTool {
|
|
|
198
198
|
/**
|
|
199
199
|
* Base styles for all header levels
|
|
200
200
|
*/
|
|
201
|
-
private static readonly BASE_STYLES = 'py-[
|
|
201
|
+
private static readonly BASE_STYLES = 'py-[7px] px-[2px] m-0 leading-[1.3]! outline-hidden [&_p]:p-0! [&_p]:m-0! [&_div]:p-0! [&_div]:m-0!';
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Styles
|
|
@@ -732,7 +732,8 @@ export class Header implements BlockTool {
|
|
|
732
732
|
wrapper.appendChild(headerRow);
|
|
733
733
|
|
|
734
734
|
const bodyPlaceholder = document.createElement('div');
|
|
735
|
-
|
|
735
|
+
// pl-8 (32px) matches the heading's left padding so body aligns with the title text start.
|
|
736
|
+
bodyPlaceholder.className = twMerge(BODY_PLACEHOLDER_STYLES, 'pl-8');
|
|
736
737
|
bodyPlaceholder.setAttribute(TOGGLE_ATTR.toggleBodyPlaceholder, '');
|
|
737
738
|
// Class changes on the body placeholder (show/hide) must not trigger didMutated →
|
|
738
739
|
// syncBlockDataToYjs, which would create a spurious Yjs undo entry when a child
|
|
@@ -746,7 +747,8 @@ export class Header implements BlockTool {
|
|
|
746
747
|
wrapper.appendChild(bodyPlaceholder);
|
|
747
748
|
|
|
748
749
|
const childContainer = document.createElement('div');
|
|
749
|
-
|
|
750
|
+
// pl-8 (32px) matches the heading's left padding so children align with the title text start.
|
|
751
|
+
childContainer.className = 'pl-8';
|
|
750
752
|
childContainer.setAttribute(TOGGLE_ATTR.toggleChildren, '');
|
|
751
753
|
// Block DOM mutations inside the children container from triggering the header tool's
|
|
752
754
|
// didMutated → syncBlockDataToYjs path (same rationale as the toggle list tool).
|
package/src/tools/index.ts
CHANGED
|
@@ -32,6 +32,8 @@ export { ItalicInlineTool as Italic } from '../components/inline-tools/inline-to
|
|
|
32
32
|
export { LinkInlineTool as Link } from '../components/inline-tools/inline-tool-link';
|
|
33
33
|
export { ConvertInlineTool as Convert } from '../components/inline-tools/inline-tool-convert';
|
|
34
34
|
export { MarkerInlineTool as Marker } from '../components/inline-tools/inline-tool-marker';
|
|
35
|
+
export { UnderlineInlineTool as Underline } from '../components/inline-tools/inline-tool-underline';
|
|
36
|
+
export { StrikethroughInlineTool as Strikethrough } from '../components/inline-tools/inline-tool-strikethrough';
|
|
35
37
|
|
|
36
38
|
// Default tools configuration for convenience
|
|
37
39
|
// Note: inlineToolbar defaults to true, so it doesn't need to be specified
|
|
@@ -48,4 +50,6 @@ export const defaultInlineTools = {
|
|
|
48
50
|
italic: {},
|
|
49
51
|
link: {},
|
|
50
52
|
marker: {},
|
|
53
|
+
underline: {},
|
|
54
|
+
strikethrough: {},
|
|
51
55
|
} as const;
|
|
@@ -17,14 +17,14 @@ export const ORDERED_INDENT_PER_LEVEL = 26;
|
|
|
17
17
|
/**
|
|
18
18
|
* Base styles for list wrapper
|
|
19
19
|
*
|
|
20
|
-
* Matches paragraph spacing: py-[
|
|
20
|
+
* Matches paragraph spacing: py-[7px] from blok-block + mt-[2px] mb-px
|
|
21
21
|
*/
|
|
22
|
-
export const BASE_STYLES = 'outline-hidden py-[
|
|
22
|
+
export const BASE_STYLES = 'outline-hidden py-[7px] mt-[2px] mb-px';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Styles for standard list items (unordered, ordered)
|
|
26
26
|
*/
|
|
27
|
-
export const ITEM_STYLES = 'outline-hidden pl-0.5 leading-[1.5] items-
|
|
27
|
+
export const ITEM_STYLES = 'outline-hidden pl-0.5 leading-[1.5] items-start';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Styles for checklist items
|
|
@@ -271,6 +271,7 @@ export const createMarker = (style: ListItemStyle, depth: number): HTMLElement =
|
|
|
271
271
|
marker.style.paddingRight = '13px';
|
|
272
272
|
marker.style.fontSize = '24px';
|
|
273
273
|
marker.style.fontFamily = 'Arial';
|
|
274
|
+
marker.style.lineHeight = '1.5rem';
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
return marker;
|
|
@@ -233,6 +233,19 @@ export class TableCellBlocks {
|
|
|
233
233
|
const totalBlocks = this.api.blocks.getBlocksCount();
|
|
234
234
|
const newBlock = this.api.blocks.insert(undefined, {}, {}, totalBlocks, true);
|
|
235
235
|
|
|
236
|
+
/**
|
|
237
|
+
* insertToDOM places the new block's holder adjacent (afterend) to the last
|
|
238
|
+
* block in the flat array, which is a cell paragraph inside the table grid.
|
|
239
|
+
* Move the holder out of the grid so focus lands outside the table.
|
|
240
|
+
*/
|
|
241
|
+
const tableBlockApi = this.gridElement.contains(newBlock.holder)
|
|
242
|
+
? this.api.blocks.getBlockByIndex(tableIndex)
|
|
243
|
+
: null;
|
|
244
|
+
|
|
245
|
+
if (tableBlockApi) {
|
|
246
|
+
tableBlockApi.holder.after(newBlock.holder);
|
|
247
|
+
}
|
|
248
|
+
|
|
236
249
|
this.api.caret.setToBlock(newBlock.id, 'start');
|
|
237
250
|
} finally {
|
|
238
251
|
this.isExitingTable = false;
|
|
@@ -671,6 +684,18 @@ export class TableCellBlocks {
|
|
|
671
684
|
// For those, check that the current block at the time of insertion belongs
|
|
672
685
|
// to this table — indicating the user was editing inside a cell.
|
|
673
686
|
if (!this.gridElement.contains(holder)) {
|
|
687
|
+
// If the holder is outside the table block's own wrapper (e.g. placed
|
|
688
|
+
// directly in the editor working area via appendToWorkingArea), it is
|
|
689
|
+
// a top-level block and must not be claimed into a cell.
|
|
690
|
+
const tableBlockIdx = this.api.blocks.getBlockIndex(this.tableBlockId);
|
|
691
|
+
const tableBlockApi = tableBlockIdx !== undefined
|
|
692
|
+
? this.api.blocks.getBlockByIndex(tableBlockIdx)
|
|
693
|
+
: null;
|
|
694
|
+
|
|
695
|
+
if (tableBlockApi && !tableBlockApi.holder.contains(holder)) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
|
|
674
699
|
const currentIndex = this.api.blocks.getCurrentBlockIndex();
|
|
675
700
|
const currentBlock = currentIndex >= 0
|
|
676
701
|
? this.api.blocks.getBlockByIndex(currentIndex)
|
|
@@ -26,9 +26,9 @@ export const ARIA_LABEL_EXPAND_KEY = 'tools.toggle.ariaLabelExpand';
|
|
|
26
26
|
/**
|
|
27
27
|
* Base styles for toggle wrapper
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* py-[7px] matches blok-block (paragraph); mt-[2px] mb-px provides block margin.
|
|
30
30
|
*/
|
|
31
|
-
export const BASE_STYLES = 'outline-hidden py-[
|
|
31
|
+
export const BASE_STYLES = 'outline-hidden py-[7px] mt-[2px] mb-px';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Styles for toggle content area
|
|
@@ -52,14 +52,21 @@ export const ARROW_ICON = '<svg aria-hidden="true" width="12" height="12" viewBo
|
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Styles for the body placeholder element
|
|
55
|
+
*
|
|
56
|
+
* Vertical padding matches a child paragraph's layout contribution:
|
|
57
|
+
* - Paragraph element: py-[7px] (7px top, 7px bottom) + mt-px mb-px (1px margins)
|
|
58
|
+
* - Combined per side: 7px padding + 1px margin = 8px
|
|
59
|
+
* Using fixed px values (not em) because py-[7px] and mt-px are also fixed.
|
|
60
|
+
*
|
|
61
|
+
* pl-7 (28px) aligns the placeholder with the title text start (arrow button width: 8px + 12px SVG + 8px = 28px).
|
|
55
62
|
*/
|
|
56
|
-
export const BODY_PLACEHOLDER_STYLES = 'hidden pl-
|
|
63
|
+
export const BODY_PLACEHOLDER_STYLES = 'hidden pl-7 pt-[8px] pb-[8px] text-gray-text leading-[1.5] cursor-pointer select-none';
|
|
57
64
|
|
|
58
65
|
/**
|
|
59
66
|
* Styles for the children container element.
|
|
60
|
-
* pl-
|
|
67
|
+
* pl-7 (28px) aligns children with the toggle list title text start (arrow button total width).
|
|
61
68
|
*/
|
|
62
|
-
export const TOGGLE_CHILDREN_STYLES = 'pl-
|
|
69
|
+
export const TOGGLE_CHILDREN_STYLES = 'pl-7';
|
|
63
70
|
|
|
64
71
|
/**
|
|
65
72
|
* Data attributes specific to the toggle tool
|