@diplodoc/folding-headings-extension 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- .yfm h1[data-folded],.yfm h2[data-folded],.yfm h3[data-folded],.yfm h4[data-folded],.yfm h5[data-folded],.yfm h6[data-folded]{position:relative;padding-left:28px}.yfm h1[data-folded]:before,.yfm h2[data-folded]:before,.yfm h3[data-folded]:before,.yfm h4[data-folded]:before,.yfm h5[data-folded]:before,.yfm h6[data-folded]:before{position:absolute;z-index:1;top:50%;left:0;content:"";cursor:pointer;background-color:currentColor;mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>');mask-repeat:no-repeat;mask-position:center;transition:transform .3s ease;transform:translateY(-50%) rotate(-90deg)}.yfm h1[data-folded]:before{width:28px;height:28px;mask-size:20px}.yfm h2[data-folded]:before,.yfm h3[data-folded]:before{left:2px;width:24px;height:24px;mask-size:20px}.yfm h4[data-folded]:before{left:6px;width:20px;height:20px;mask-size:16px}.yfm h5[data-folded]:before{left:8px;width:20px;height:20px;mask-size:14px}.yfm h6[data-folded]:before{left:8px;width:20px;height:20px;mask-size:12px}.yfm h1[data-folded=false]:before,.yfm h2[data-folded=false]:before,.yfm h3[data-folded=false]:before,.yfm h4[data-folded=false]:before,.yfm h5[data-folded=false]:before,.yfm h6[data-folded=false]:before{transform:translateY(-50%)}.heading-section-content{display:none;padding-left:28px;overflow:hidden;transition:height .3s ease-in-out}.heading-section-content>.heading-section{margin-left:-28px}.heading-section>h1,.heading-section>h2,.heading-section>h3,.heading-section>h4,.heading-section>h5,.heading-section>h6{cursor:pointer;position:relative;padding-left:28px}.heading-section>h1:before,.heading-section>h2:before,.heading-section>h3:before,.heading-section>h4:before,.heading-section>h5:before,.heading-section>h6:before{position:absolute;z-index:1;top:50%;left:0;content:"";cursor:pointer;background-color:currentColor;mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>');mask-repeat:no-repeat;mask-position:center;transition:transform .3s ease;transform:translateY(-50%) rotate(-90deg)}.heading-section>h1 .yfm-anchor,.heading-section>h2 .yfm-anchor,.heading-section>h3 .yfm-anchor,.heading-section>h4 .yfm-anchor,.heading-section>h5 .yfm-anchor,.heading-section>h6 .yfm-anchor{margin-left:-52px}.heading-section>h1:before{width:28px;height:28px;mask-size:20px}.heading-section>h2:before,.heading-section>h3:before{left:2px;width:24px;height:24px;mask-size:20px}.heading-section>h4:before{left:6px;width:20px;height:20px;mask-size:16px}.heading-section>h5:before{left:8px;width:20px;height:20px;mask-size:14px}.heading-section>h6:before{left:8px;width:20px;height:20px;mask-size:12px}.heading-section.open>.heading-section-content{display:revert}.heading-section.open>h1:before,.heading-section.open>h2:before,.heading-section.open>h3:before,.heading-section.open>h4:before,.heading-section.open>h5:before,.heading-section.open>h6:before{transform:translateY(-50%)}
1
+ .yfm h1[data-folded],.yfm h2[data-folded],.yfm h3[data-folded],.yfm h4[data-folded],.yfm h5[data-folded],.yfm h6[data-folded]{position:relative;padding-left:28px}.yfm h1[data-folded]:before,.yfm h2[data-folded]:before,.yfm h3[data-folded]:before,.yfm h4[data-folded]:before,.yfm h5[data-folded]:before,.yfm h6[data-folded]:before{position:absolute;z-index:1;top:50%;left:0;content:"";cursor:pointer;background-color:currentColor;mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>');mask-repeat:no-repeat;mask-position:center;transition:transform .3s ease;transform:translateY(-50%) rotate(-90deg)}.yfm h1[data-folded]:before{width:28px;height:28px;mask-size:20px}.yfm h2[data-folded]:before,.yfm h3[data-folded]:before{left:2px;width:24px;height:24px;mask-size:20px}.yfm h4[data-folded]:before{left:6px;width:20px;height:20px;mask-size:16px}.yfm h5[data-folded]:before{left:8px;width:20px;height:20px;mask-size:14px}.yfm h6[data-folded]:before{left:8px;width:20px;height:20px;mask-size:12px}.yfm h1[data-folded=false]:before,.yfm h2[data-folded=false]:before,.yfm h3[data-folded=false]:before,.yfm h4[data-folded=false]:before,.yfm h5[data-folded=false]:before,.yfm h6[data-folded=false]:before{transform:translateY(-50%)}.heading-section-content{display:none;padding-left:28px;transition:height .3s ease-in-out}.heading-section-content>.heading-section{margin-left:-28px}.heading-section>h1,.heading-section>h2,.heading-section>h3,.heading-section>h4,.heading-section>h5,.heading-section>h6{cursor:pointer;position:relative;padding-left:28px}.heading-section>h1:before,.heading-section>h2:before,.heading-section>h3:before,.heading-section>h4:before,.heading-section>h5:before,.heading-section>h6:before{position:absolute;z-index:1;top:50%;left:0;content:"";cursor:pointer;background-color:currentColor;mask-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/></svg>');mask-repeat:no-repeat;mask-position:center;transition:transform .3s ease;transform:translateY(-50%) rotate(-90deg)}.heading-section>h1 .yfm-anchor,.heading-section>h2 .yfm-anchor,.heading-section>h3 .yfm-anchor,.heading-section>h4 .yfm-anchor,.heading-section>h5 .yfm-anchor,.heading-section>h6 .yfm-anchor{margin-left:-52px}.heading-section>h1:before{width:28px;height:28px;mask-size:20px}.heading-section>h2:before,.heading-section>h3:before{left:2px;width:24px;height:24px;mask-size:20px}.heading-section>h4:before{left:6px;width:20px;height:20px;mask-size:16px}.heading-section>h5:before{left:8px;width:20px;height:20px;mask-size:14px}.heading-section>h6:before{left:8px;width:20px;height:20px;mask-size:12px}.heading-section.open>.heading-section-content{display:revert}.heading-section.open>h1:before,.heading-section.open>h2:before,.heading-section.open>h3:before,.heading-section.open>h4:before,.heading-section.open>h5:before,.heading-section.open>h6:before{transform:translateY(-50%)}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/runtime/styles/_editor.scss", "../../src/runtime/styles/_mixins.scss", "../../src/runtime/styles/index.scss"],
4
- "sourcesContent": ["// this styles for folding headings in markdown editor\n\n@use './mixins' as m;\n\n.yfm {\n h1[data-folded],\n h2[data-folded],\n h3[data-folded],\n h4[data-folded],\n h5[data-folded],\n h6[data-folded] {\n @include m.chevron();\n }\n\n h1[data-folded] {\n @include m.chevron_size_xl();\n }\n\n h2[data-folded],\n h3[data-folded] {\n @include m.chevron_size_l();\n }\n\n h4[data-folded] {\n @include m.chevron_size_m();\n }\n\n h5[data-folded] {\n @include m.chevron_size_s();\n }\n\n h6[data-folded] {\n @include m.chevron_size_xs();\n }\n\n h1[data-folded=false],\n h2[data-folded=false],\n h3[data-folded=false],\n h4[data-folded=false],\n h5[data-folded=false],\n h6[data-folded=false] {\n @include m.chevron_open();\n }\n}\n", "$chevronIcon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06\" clip-rule=\"evenodd\"/></svg>');\n\n@mixin chevron() {\n position: relative;\n\n padding-left: 28px;\n\n &::before {\n position: absolute;\n z-index: 1;\n top: 50%;\n left: 0;\n\n content: '';\n cursor: pointer;\n\n background-color: currentColor;\n mask-image: $chevronIcon;\n mask-repeat: no-repeat;\n mask-position: center;\n\n transition: transform 0.3s ease;\n transform: translateY(-50%) rotate(-90deg);\n }\n}\n\n@mixin chevron_size_xs() {\n &::before {\n left: 8px;\n\n width: 20px;\n height: 20px;\n\n mask-size: 12px;\n }\n}\n\n@mixin chevron_size_s() {\n &::before {\n left: 8px;\n\n width: 20px;\n height: 20px;\n\n mask-size: 14px;\n }\n}\n\n@mixin chevron_size_m() {\n &::before {\n left: 6px;\n\n width: 20px;\n height: 20px;\n\n mask-size: 16px;\n }\n}\n\n@mixin chevron_size_l() {\n &::before {\n left: 2px;\n\n width: 24px;\n height: 24px;\n\n mask-size: 20px;\n }\n}\n\n@mixin chevron_size_xl() {\n &::before {\n width: 28px;\n height: 28px;\n\n mask-size: 20px;\n }\n}\n\n@mixin chevron_open() {\n &::before {\n transform: translateY(-50%);\n }\n}\n", "@use './mixins' as m;\n@use './editor';\n\n$paddingLeft: 28px;\n$yfmAnchorWidth: 24px;\n\n.heading-section {\n $class: &;\n\n &-content {\n display: none;\n padding-left: $paddingLeft;\n overflow: hidden;\n transition: height 0.3s ease-in-out;\n\n & > #{$class} {\n margin-left: -#{$paddingLeft};\n }\n }\n\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n cursor: pointer;\n\n @include m.chevron();\n\n .yfm-anchor {\n margin-left: -#{$yfmAnchorWidth + $paddingLeft}; // width of yfm-anchor (24px) + padding of heading (28px)\n }\n }\n\n > h1 {\n @include m.chevron_size_xl();\n }\n\n > h2,\n > h3 {\n @include m.chevron_size_l();\n }\n\n > h4 {\n @include m.chevron_size_m();\n }\n\n > h5 {\n @include m.chevron_size_s();\n }\n\n > h6 {\n @include m.chevron_size_xs();\n }\n\n &.open {\n > #{$class}-content {\n display: revert;\n }\n\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n @include m.chevron_open();\n }\n }\n}\n"],
5
- "mappings": "AAKI,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aCFA,SAAA,SAEA,aAAA,KAEA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QACI,SAAA,SACA,QAAA,EACA,IAAA,IACA,KAAA,EAEA,QAAA,GACA,OAAA,QAEA,iBAAA,aACA,WAjBM,6UAkBN,YAAA,UACA,cAAA,OAEA,WAAA,UAAA,IAAA,KACA,UAAA,WAAA,MAAA,OAAA,QAiDJ,CDlEA,ICkEA,EAAA,CAAA,YAAA,QACI,MAAA,KACA,OAAA,KAEA,UAAA,KAfJ,CDvDA,ICuDA,EAAA,CAAA,YAAA,QAAA,CDvDA,ICuDA,EAAA,CAAA,YAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CD5CA,IC4CA,EAAA,CAAA,YAAA,QACI,KAAA,IAEA,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,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WACI,YAAA,MDwCR,CCxDI,eDwDJ,CAAA,EAAA,QACI,MAAA,KACA,OAAA,KAEA,UAAA,KAfJ,CC7CI,eD6CJ,CAAA,EAAA,QAAA,CC7CI,eD6CJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CClCI,eDkCJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CCvBI,eDuBJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CCZI,eDYJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KCwBA,CA1CA,eA0CA,CAAA,IAAA,CAAA,CAhDJ,wBAiDQ,QAAA,ODsBR,CCjEI,eDiEJ,CCvBI,IDuBJ,CAAA,EAAA,QAAA,CCjEI,eDiEJ,CCvBI,IDuBJ,CAAA,EAAA,QAAA,CCjEI,eDiEJ,CCvBI,IDuBJ,CAAA,EAAA,QAAA,CCjEI,eDiEJ,CCvBI,IDuBJ,CAAA,EAAA,QAAA,CCjEI,eDiEJ,CCvBI,IDuBJ,CAAA,EAAA,QAAA,CCjEI,eDiEJ,CCvBI,IDuBJ,CAAA,EAAA,QACI,UAAA,WAAA",
4
+ "sourcesContent": ["// this styles for folding headings in markdown editor\n\n@use './mixins' as m;\n\n.yfm {\n h1[data-folded],\n h2[data-folded],\n h3[data-folded],\n h4[data-folded],\n h5[data-folded],\n h6[data-folded] {\n @include m.chevron();\n }\n\n h1[data-folded] {\n @include m.chevron_size_xl();\n }\n\n h2[data-folded],\n h3[data-folded] {\n @include m.chevron_size_l();\n }\n\n h4[data-folded] {\n @include m.chevron_size_m();\n }\n\n h5[data-folded] {\n @include m.chevron_size_s();\n }\n\n h6[data-folded] {\n @include m.chevron_size_xs();\n }\n\n h1[data-folded=false],\n h2[data-folded=false],\n h3[data-folded=false],\n h4[data-folded=false],\n h5[data-folded=false],\n h6[data-folded=false] {\n @include m.chevron_open();\n }\n}\n", "$chevronIcon: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06\" clip-rule=\"evenodd\"/></svg>');\n\n@mixin chevron() {\n position: relative;\n\n padding-left: 28px;\n\n &::before {\n position: absolute;\n z-index: 1;\n top: 50%;\n left: 0;\n\n content: '';\n cursor: pointer;\n\n background-color: currentColor;\n mask-image: $chevronIcon;\n mask-repeat: no-repeat;\n mask-position: center;\n\n transition: transform 0.3s ease;\n transform: translateY(-50%) rotate(-90deg);\n }\n}\n\n@mixin chevron_size_xs() {\n &::before {\n left: 8px;\n\n width: 20px;\n height: 20px;\n\n mask-size: 12px;\n }\n}\n\n@mixin chevron_size_s() {\n &::before {\n left: 8px;\n\n width: 20px;\n height: 20px;\n\n mask-size: 14px;\n }\n}\n\n@mixin chevron_size_m() {\n &::before {\n left: 6px;\n\n width: 20px;\n height: 20px;\n\n mask-size: 16px;\n }\n}\n\n@mixin chevron_size_l() {\n &::before {\n left: 2px;\n\n width: 24px;\n height: 24px;\n\n mask-size: 20px;\n }\n}\n\n@mixin chevron_size_xl() {\n &::before {\n width: 28px;\n height: 28px;\n\n mask-size: 20px;\n }\n}\n\n@mixin chevron_open() {\n &::before {\n transform: translateY(-50%);\n }\n}\n", "@use './mixins' as m;\n@use './editor';\n\n$paddingLeft: 28px;\n$yfmAnchorWidth: 24px;\n\n.heading-section {\n $class: &;\n\n &-content {\n display: none;\n padding-left: $paddingLeft;\n transition: height 0.3s ease-in-out;\n\n & > #{$class} {\n margin-left: -#{$paddingLeft};\n }\n }\n\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n cursor: pointer;\n\n @include m.chevron();\n\n .yfm-anchor {\n margin-left: -#{$yfmAnchorWidth + $paddingLeft}; // width of yfm-anchor (24px) + padding of heading (28px)\n }\n }\n\n > h1 {\n @include m.chevron_size_xl();\n }\n\n > h2,\n > h3 {\n @include m.chevron_size_l();\n }\n\n > h4 {\n @include m.chevron_size_m();\n }\n\n > h5 {\n @include m.chevron_size_s();\n }\n\n > h6 {\n @include m.chevron_size_xs();\n }\n\n &.open {\n > #{$class}-content {\n display: revert;\n }\n\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n @include m.chevron_open();\n }\n }\n}\n"],
5
+ "mappings": "AAKI,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aAAA,CAAA,IAAA,EAAA,CAAA,aCFA,SAAA,SAEA,aAAA,KAEA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QAAA,CDFA,ICEA,EAAA,CAAA,YAAA,QACI,SAAA,SACA,QAAA,EACA,IAAA,IACA,KAAA,EAEA,QAAA,GACA,OAAA,QAEA,iBAAA,aACA,WAjBM,6UAkBN,YAAA,UACA,cAAA,OAEA,WAAA,UAAA,IAAA,KACA,UAAA,WAAA,MAAA,OAAA,QAiDJ,CDlEA,ICkEA,EAAA,CAAA,YAAA,QACI,MAAA,KACA,OAAA,KAEA,UAAA,KAfJ,CDvDA,ICuDA,EAAA,CAAA,YAAA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,MAAA,OAAA,QCOA,CAfA,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WAAA,CAfA,eAeA,CAAA,GAAA,CAAA,WACI,YAAA,MDyCR,CCzDI,eDyDJ,CAAA,EAAA,QACI,MAAA,KACA,OAAA,KAEA,UAAA,KAfJ,CC9CI,eD8CJ,CAAA,EAAA,QAAA,CC9CI,eD8CJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CCnCI,eDmCJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CCxBI,eDwBJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KAjBJ,CCbI,eDaJ,CAAA,EAAA,QACI,KAAA,IAEA,MAAA,KACA,OAAA,KAEA,UAAA,KCuBA,CA1CA,eA0CA,CAAA,IAAA,CAAA,CA/CJ,wBAgDQ,QAAA,ODuBR,CClEI,eDkEJ,CCxBI,IDwBJ,CAAA,EAAA,QAAA,CClEI,eDkEJ,CCxBI,IDwBJ,CAAA,EAAA,QAAA,CClEI,eDkEJ,CCxBI,IDwBJ,CAAA,EAAA,QAAA,CClEI,eDkEJ,CCxBI,IDwBJ,CAAA,EAAA,QAAA,CClEI,eDkEJ,CCxBI,IDwBJ,CAAA,EAAA,QAAA,CClEI,eDkEJ,CCxBI,IDwBJ,CAAA,EAAA,QACI,UAAA,WAAA",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var n="heading-section",i={DataId:"data-diplodoc-id",DataKey:"data-diplodoc-key"};var a="heading_sections",c={Heading:".yfm .heading-section > h1,h2,h3,h4,h5,h6",Section:".yfm .heading-section",Content:".yfm .heading-section-content"},o={Open:"open"};var A=t=>{let e=t.composedPath();return Array.isArray(e)&&e.length>0?e[0]:t.target},C=t=>{let e=A(t);return!e||!e.matches};var I=class{__doc;constructor(e){this.__doc=e,this.__doc.addEventListener("click",this._onDocClick)}open(e){for(let g of this._findSections(e))g.classList.add(o.Open)}toggle(e){for(let g of this._findSections(e))g.classList.toggle(o.Open)}close(e){for(let g of this._findSections(e))g.classList.remove(o.Open)}destroy(){this.__doc.removeEventListener("click",this._onDocClick)}_findSections(e){return Array.from(this.__doc.querySelectorAll(`section[${i.DataKey}=${n}][${i.DataId}=${e}]`))}_onDocClick=e=>{if(C(e))return;let g=this._findHeading(e);g&&this._toogleSection(g)};_findHeading(e){let g=A(e);return this._matchHeading(g)?g:e.composedPath?.()?.find(this._matchHeading)}_matchHeading=e=>e instanceof HTMLElement?e?.matches?.(c.Heading)&&e.parentElement?.matches(c.Section):!1;_toogleSection(e){let g=e.parentElement;g instanceof HTMLElement&&g.classList.toggle(o.Open)}};typeof window<"u"&&typeof document<"u"&&!window[a]&&(window[a]=new I(document));})();
1
+ "use strict";(()=>{var n="heading-section",i={DataId:"data-diplodoc-id",DataKey:"data-diplodoc-key"};var c="heading_sections",a={Heading:".yfm .heading-section > h1,h2,h3,h4,h5,h6",Section:".yfm .heading-section",Content:".yfm .heading-section-content"},o={Open:"open"};var A=t=>{let e=t.composedPath();return Array.isArray(e)&&e.length>0?e[0]:t.target},C=t=>{let e=A(t);return!e||!e.matches};var I=class{__doc;constructor(e){this.__doc=e,this.__doc.addEventListener("click",this._onDocClick)}open(e){for(let g of this._findSections(e))g.classList.add(o.Open)}toggle(e){for(let g of this._findSections(e))g.classList.toggle(o.Open)}close(e){for(let g of this._findSections(e))g.classList.remove(o.Open)}destroy(){this.__doc.removeEventListener("click",this._onDocClick)}_findSections(e){return Array.from(this.__doc.querySelectorAll(`section[${i.DataKey}=${n}][${i.DataId}=${e}]`))}_onDocClick=e=>{if(C(e))return;let g=this._findHeading(e);g&&this._toogleSection(g)};_findHeading(e){let g=A(e);return this._matchHeading(g)?g:e.composedPath?.()?.find(this._matchHeading)}_matchHeading=e=>e instanceof HTMLElement?e?.matches?.(a.Heading)&&e.parentElement?.matches(a.Section):!1;_toogleSection(e){let g=e.parentElement;g instanceof HTMLElement&&g.classList.toggle(o.Open)}};typeof window<"u"&&typeof document<"u"&&!window[c]&&(window[c]=new I(document));})();
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diplodoc/folding-headings-extension",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Folding headings extension for Diplodoc platform ",
5
5
  "main": "build/plugin/index.js",
6
6
  "types": "build/plugin/index.d.ts",
@@ -31,10 +31,11 @@
31
31
  ],
32
32
  "scripts": {
33
33
  "build": "run-p build:*",
34
- "build:js": "./esbuild/build.mjs",
35
34
  "build:declarations": "tsc --emitDeclarationOnly --outDir ./build",
35
+ "build:js": "./esbuild/build.mjs",
36
36
  "lint": "eslint .",
37
37
  "lint:fix": "eslint --fix .",
38
+ "prepublishOnly": "npm run build",
38
39
  "test": "jest"
39
40
  },
40
41
  "devDependencies": {