@simple-reporting/base 1.0.39 → 1.0.41
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/dev/package.json +1 -1
- package/dev/src/App.vue +1 -0
- package/dev/src/assets/scss/app.scss +0 -1
- package/dev/src/assets/scss/components/{note/accordion.scss → accordion.scss} +20 -0
- package/dev/src/assets/scss/editor.scss +1 -0
- package/dev/src/assets/scss/general.scss +18 -0
- package/dev/src/assets/scss/pdf.scss +11 -0
- package/dev/src/assets/scss/placeholders/grid.scss +6 -0
- package/dev/src/assets/scss/web.scss +1 -1
- package/dev/src/assets/scss/xbrl.scss +12 -1
- package/dev/src/components/PageMain.vue +5 -3
- package/dev/src/entries/pdf.ts +5 -0
- package/dev/srl.config.json +72 -7
- package/livingdocs/010.Titles/010.title-h1/scss/_spacing-variations.scss +0 -2
- package/livingdocs/010.Titles/010.title-h1/scss/general.scss +1 -2
- package/livingdocs/010.Titles/010.title-h1/scss/web.scss +7 -0
- package/livingdocs/010.Titles/020.title-h2/scss/_spacing-variations.scss +0 -2
- package/livingdocs/010.Titles/020.title-h2/scss/general.scss +12 -2
- package/livingdocs/010.Titles/020.title-h2/scss/xbrl.scss +2 -1
- package/livingdocs/010.Titles/030.title-h3/scss/_spacing-variations.scss +0 -2
- package/livingdocs/010.Titles/030.title-h3/scss/general.scss +2 -2
- package/livingdocs/010.Titles/030.title-h3/scss/xbrl.scss +2 -1
- package/livingdocs/010.Titles/040.title-h4/scss/_spacing-variations.scss +0 -2
- package/livingdocs/010.Titles/040.title-h4/scss/general.scss +2 -2
- package/livingdocs/010.Titles/040.title-h4/scss/xbrl.scss +2 -1
- package/livingdocs/010.Titles/050.title-h5/scss/_spacing-variations.scss +0 -2
- package/livingdocs/010.Titles/050.title-h5/scss/general.scss +1 -2
- package/livingdocs/010.Titles/060.title-h6/scss/_spacing-variations.scss +0 -2
- package/livingdocs/010.Titles/060.title-h6/scss/general.scss +2 -2
- package/livingdocs/020.Text/010.lead/scss/general.scss +1 -2
- package/livingdocs/020.Text/020.paragraph/scss/_spacing-variations.scss +1 -2
- package/livingdocs/020.Text/020.paragraph/scss/general.scss +5 -2
- package/livingdocs/020.Text/040.link/scss/_spacing-variations.scss +22 -0
- package/livingdocs/020.Text/040.link/scss/general.scss +22 -2
- package/livingdocs/020.Text/050.quote/scss/general.scss +2 -0
- package/livingdocs/020.Text/060.quote-with-portrait/scss/_spacing-variations.scss +1 -2
- package/livingdocs/020.Text/060.quote-with-portrait/scss/general.scss +13 -2
- package/livingdocs/020.Text/060.quote-with-portrait/scss/web.scss +7 -0
- package/livingdocs/020.Text/070.footnote-container/scss/_spacing-variations.scss +0 -2
- package/livingdocs/020.Text/080.footnote-item/scss/general.scss +1 -2
- package/livingdocs/020.Text/080.footnote-item/scss/word.scss +8 -0
- package/livingdocs/030.Lists/010.unordered-list/scss/_spacing-variations.scss +0 -2
- package/livingdocs/030.Lists/010.unordered-list/scss/general.scss +1 -2
- package/livingdocs/030.Lists/040.list-item-unordered-list/scss/general.scss +1 -2
- package/livingdocs/040.Media/010.table/scss/_spacing-variations.scss +0 -2
- package/livingdocs/040.Media/010.table/scss/general.scss +8 -2
- package/livingdocs/040.Media/010.table/scss/word.scss +18 -0
- package/livingdocs/040.Media/020.image/scss/_spacing-variations.scss +0 -2
- package/livingdocs/040.Media/020.image/scss/general.scss +1 -2
- package/livingdocs/040.Media/020.image/scss/pdf.scss +1 -0
- package/livingdocs/040.Media/020.image/scss/web.scss +19 -5
- package/livingdocs/040.Media/030.video/ld-conf.json +1 -6
- package/livingdocs/040.Media/030.video/properties.json +7 -0
- package/livingdocs/040.Media/030.video/scss/_spacing-variations.scss +0 -2
- package/livingdocs/040.Media/030.video/scss/editor.scss +10 -0
- package/livingdocs/040.Media/030.video/scss/general.scss +7 -3
- package/livingdocs/040.Media/030.video/scss/pdf.scss +8 -0
- package/livingdocs/040.Media/030.video/video.html +27 -30
- package/livingdocs/040.Media/030.video/video.vue +71 -32
- package/livingdocs/060.Buttons/010.button-container/button-container.html +6 -1
- package/livingdocs/060.Buttons/020.button/button.html +7 -1
- package/livingdocs/060.Buttons/020.button/scss/general.scss +2 -2
- package/livingdocs/070.Container/010.aside-content-container/aside-content-container.html +1 -1
- package/livingdocs/070.Container/010.aside-content-container/ld-conf.json +1 -1
- package/livingdocs/070.Container/010.aside-content-container/scss/general.scss +4 -0
- package/livingdocs/070.Container/010.aside-content-container/scss/pdf.scss +5 -0
- package/livingdocs/070.Container/010.aside-content-container/scss/web.scss +12 -0
- package/livingdocs/070.Container/020.columns-container/columns-container.html +1 -1
- package/livingdocs/070.Container/020.columns-container/ld-conf.json +1 -1
- package/livingdocs/070.Container/020.columns-container/scss/app.scss +1 -0
- package/livingdocs/070.Container/020.columns-container/scss/general.scss +5 -0
- package/livingdocs/070.Container/020.columns-container/scss/pdf.scss +7 -0
- package/livingdocs/070.Container/020.columns-container/scss/word.scss +1 -0
- package/livingdocs/070.Container/020.columns-container/scss/xbrl.scss +2 -0
- package/livingdocs/070.Container/030.background-container/scss/general.scss +1 -2
- package/livingdocs/080.CV/010.cv/scss/editor.scss +10 -1
- package/livingdocs/080.CV/010.cv/scss/general.scss +1 -2
- package/livingdocs/080.CV/010.cv/scss/web.scss +1 -1
- package/livingdocs/080.CV/010.cv/scss/xbrl.scss +2 -1
- package/livingdocs/080.CV/020.cv-time-span/scss/_spacing-variations.scss +0 -2
- package/livingdocs/080.CV/020.cv-time-span/scss/general.scss +1 -2
- package/livingdocs/080.CV/020.cv-time-span/scss/xbrl.scss +2 -1
- package/livingdocs/090.Signatures/010.signature-container/scss/xbrl.scss +3 -1
- package/livingdocs/090.Signatures/020.signature-item/scss/xbrl.scss +1 -0
- package/livingdocs/100.Misc/010.anchor/scss/editor.scss +4 -0
- package/livingdocs/100.Misc/020.accordion/accordion.html +9 -9
- package/livingdocs/110.PDF/010.pdf-pagebreak/scss/editor.scss +1 -0
- package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/editor.scss +1 -0
- package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/properties.json +2 -2
- package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/scss/general.scss +3 -0
- package/livingdocs/110.PDF/075.pdf-chapter-navigation-item/scss/editor.scss +1 -0
- package/livingdocs/110.PDF/075.pdf-chapter-navigation-item/scss/web.scss +1 -0
- package/livingdocs/110.PDF/100.pdf-toc-item/scss/general.scss +6 -8
- package/livingdocs/120.Startpage/010.hero-video/hero-video.html +15 -0
- package/livingdocs/120.Startpage/010.hero-video/ld-conf.json +5 -0
- package/livingdocs/120.Startpage/010.hero-video/properties.json +1 -0
- package/livingdocs/120.Startpage/010.hero-video/scss/_spacing-variations.scss +3 -0
- package/livingdocs/120.Startpage/010.hero-video/scss/app.scss +2 -0
- package/livingdocs/120.Startpage/010.hero-video/scss/editor.scss +9 -0
- package/livingdocs/120.Startpage/010.hero-video/scss/web.scss +77 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/ld-conf.json +18 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/properties.json +1 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/_spacing-variations.scss +4 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/app.scss +2 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/editor.scss +22 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/scss/web.scss +40 -0
- package/livingdocs/120.Startpage/020.teaser-title-image-quote/teaser-title-image-quote.html +50 -0
- package/livingdocs/120.Startpage/030.teaser-quote/ld-conf.json +25 -0
- package/livingdocs/120.Startpage/030.teaser-quote/properties.json +1 -0
- package/livingdocs/120.Startpage/030.teaser-quote/scss/_spacing-variations.scss +3 -0
- package/livingdocs/120.Startpage/030.teaser-quote/scss/app.scss +2 -0
- package/livingdocs/120.Startpage/030.teaser-quote/scss/editor.scss +6 -0
- package/livingdocs/120.Startpage/030.teaser-quote/scss/web.scss +125 -0
- package/livingdocs/120.Startpage/030.teaser-quote/teaser-quote.html +53 -0
- package/livingdocs/120.Startpage/040.teaser/ld-conf.json +23 -0
- package/livingdocs/120.Startpage/040.teaser/scss/_spacing-variations.scss +3 -0
- package/livingdocs/120.Startpage/040.teaser/scss/app.scss +2 -0
- package/livingdocs/120.Startpage/040.teaser/scss/editor.scss +6 -0
- package/livingdocs/120.Startpage/040.teaser/scss/web.scss +72 -0
- package/livingdocs/120.Startpage/040.teaser/teaser.html +39 -0
- package/livingdocs/130.Hosting_Components/010.download-center/download-center.html +6 -2
- package/livingdocs/130.Hosting_Components/020.search/scss/web.scss +11 -44
- package/livingdocs/130.Hosting_Components/020.search/search.html +7 -1
- package/livingdocs/130.Hosting_Components/020.search/search.vue +1 -1
- package/livingdocs/130.Hosting_Components/020.search/searchHighlightOnTarget.vue +249 -0
- package/livingdocs/999.Properties/background-color/properties.json +23 -0
- package/livingdocs/999.Properties/font-color/properties.json +15 -0
- package/package.json +1 -1
- package/scripts/config.js +7 -4
- package/scss/colors/mixins.scss +3 -0
- package/scss/helpers/mixins.scss +22 -0
- package/scss/spacer/mixins.scss +121 -12
- package/srl/srl/fa/index.scss +2 -2
- package/srl/srl/fa/source-free.scss +1 -4
- package/srl/srl/pdf/PDFNestedContainers.ts +122 -0
- package/srl/srl/pdf/PDFNotes.ts +4 -2
- package/srl/srl/pdf/PDFSetPageNumbers.ts +3 -1
- package/dev/src/assets/scss/margins.scss +0 -57
- /package/livingdocs/{110.PDF/060.pdf-chapter-navigation-item → 070.Container/020.columns-container}/scss/editor.scss +0 -0
- /package/livingdocs/{110.PDF/021.pdf-columnbreak → 070.Container/020.columns-container}/scss/web.scss +0 -0
- /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/pdf-columnbreak.html +0 -0
- /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/general.scss +0 -0
- /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 020.pdf-columnbreak}/scss/web.scss +0 -0
- /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/word.scss +0 -0
- /package/livingdocs/110.PDF/{021.pdf-columnbreak → 020.pdf-columnbreak}/scss/xbrl.scss +0 -0
- /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/pdf-column-container.html +0 -0
- /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/properties.json +0 -0
- /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/scss/editor.scss +0 -0
- /package/livingdocs/110.PDF/{020.pdf-column-container → 025.pdf-column-container}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/pdf-cover.html +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/scss/editor.scss +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 030.pdf-cover}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 030.pdf-cover}/scss/web.scss +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 030.pdf-cover}/scss/word.scss +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 030.pdf-cover}/scss/xbrl.scss +0 -0
- /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/pdf-landscape-container.html +0 -0
- /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/properties.json +0 -0
- /package/livingdocs/110.PDF/{075.pdf-landscape-container → 040.pdf-landscape-container}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/pdf-publication-title.html +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/scss/editor.scss +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/scss/general.scss +0 -0
- /package/livingdocs/110.PDF/{030.pdf-publication-title → 050.pdf-publication-title}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 050.pdf-publication-title}/scss/web.scss +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 050.pdf-publication-title}/scss/word.scss +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 050.pdf-publication-title}/scss/xbrl.scss +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/pdf-chapter-title.html +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/scss/editor.scss +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/scss/general.scss +0 -0
- /package/livingdocs/110.PDF/{040.pdf-chapter-title → 060.pdf-chapter-title}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 060.pdf-chapter-title}/scss/web.scss +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 060.pdf-chapter-title}/scss/word.scss +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 060.pdf-chapter-title}/scss/xbrl.scss +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/pdf-chapter-navigation.html +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/scss/editor.scss +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/scss/general.scss +0 -0
- /package/livingdocs/110.PDF/{050.pdf-chapter-navigation-container → 070.pdf-chapter-navigation-container}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 070.pdf-chapter-navigation-container}/scss/web.scss +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 070.pdf-chapter-navigation-container}/scss/word.scss +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 070.pdf-chapter-navigation-container}/scss/xbrl.scss +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/ld-conf.json +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/pdf-chapter-navigation-item.html +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/properties.json +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/scss/general.scss +0 -0
- /package/livingdocs/110.PDF/{060.pdf-chapter-navigation-item → 075.pdf-chapter-navigation-item}/scss/pdf.scss +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 075.pdf-chapter-navigation-item}/scss/word.scss +0 -0
- /package/livingdocs/110.PDF/{070.pdf-cover → 075.pdf-chapter-navigation-item}/scss/xbrl.scss +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { nextTick, onBeforeUnmount, onMounted, watch } from 'vue'
|
|
3
|
+
import { useRoute } from 'vue-router'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
rootSelector?: string
|
|
7
|
+
highlightClass?: string
|
|
8
|
+
queryParam?: string
|
|
9
|
+
}>(), {
|
|
10
|
+
rootSelector: '#srl-page-main',
|
|
11
|
+
highlightClass: 'searchTarget',
|
|
12
|
+
queryParam: 'searchTarget'
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const route = useRoute()
|
|
16
|
+
|
|
17
|
+
let mutationObserver: MutationObserver | null = null
|
|
18
|
+
let highlightTimeout: ReturnType<typeof setTimeout> | null = null
|
|
19
|
+
let isApplyingHighlight = false
|
|
20
|
+
let hasScrolledToHighlight = false
|
|
21
|
+
|
|
22
|
+
function getRootElement(): HTMLElement | null {
|
|
23
|
+
return document.querySelector(props.rootSelector)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function escapeRegExp(value: string): string {
|
|
27
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function removeHighlights(root: HTMLElement): void {
|
|
31
|
+
const highlights = root.querySelectorAll(`span.${props.highlightClass}`)
|
|
32
|
+
|
|
33
|
+
highlights.forEach((highlight) => {
|
|
34
|
+
const parent = highlight.parentNode
|
|
35
|
+
if (!parent) return
|
|
36
|
+
|
|
37
|
+
parent.replaceChild(document.createTextNode(highlight.textContent ?? ''), highlight)
|
|
38
|
+
parent.normalize()
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function highlightTextNodes(root: HTMLElement, term: string): number {
|
|
43
|
+
const safeTermPattern = escapeRegExp(term)
|
|
44
|
+
const regex = new RegExp(`(${safeTermPattern})`, 'gi')
|
|
45
|
+
|
|
46
|
+
const walker = document.createTreeWalker(
|
|
47
|
+
root,
|
|
48
|
+
NodeFilter.SHOW_TEXT,
|
|
49
|
+
{
|
|
50
|
+
acceptNode(node) {
|
|
51
|
+
const parent = node.parentElement
|
|
52
|
+
if (!parent) return NodeFilter.FILTER_REJECT
|
|
53
|
+
|
|
54
|
+
const tag = parent.tagName.toLowerCase()
|
|
55
|
+
if (
|
|
56
|
+
tag === 'script' ||
|
|
57
|
+
tag === 'style' ||
|
|
58
|
+
tag === 'noscript' ||
|
|
59
|
+
tag === 'textarea'
|
|
60
|
+
) {
|
|
61
|
+
return NodeFilter.FILTER_REJECT
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (parent.closest(`.${props.highlightClass}`)) {
|
|
65
|
+
return NodeFilter.FILTER_REJECT
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const text = node.textContent
|
|
69
|
+
if (!text || !text.trim()) return NodeFilter.FILTER_SKIP
|
|
70
|
+
|
|
71
|
+
regex.lastIndex = 0
|
|
72
|
+
if (!regex.test(text)) return NodeFilter.FILTER_SKIP
|
|
73
|
+
|
|
74
|
+
return NodeFilter.FILTER_ACCEPT
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
const textNodes: Text[] = []
|
|
80
|
+
let node: Node | null = null
|
|
81
|
+
|
|
82
|
+
while ((node = walker.nextNode())) {
|
|
83
|
+
textNodes.push(node as Text)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let hitCount = 0
|
|
87
|
+
|
|
88
|
+
for (const textNode of textNodes) {
|
|
89
|
+
const text = textNode.textContent ?? ''
|
|
90
|
+
regex.lastIndex = 0
|
|
91
|
+
|
|
92
|
+
const matches = [...text.matchAll(regex)]
|
|
93
|
+
if (!matches.length) continue
|
|
94
|
+
|
|
95
|
+
const fragment = document.createDocumentFragment()
|
|
96
|
+
let lastIndex = 0
|
|
97
|
+
|
|
98
|
+
for (const match of matches) {
|
|
99
|
+
const matchText = match[0]
|
|
100
|
+
const index = match.index ?? 0
|
|
101
|
+
|
|
102
|
+
if (index > lastIndex) {
|
|
103
|
+
fragment.appendChild(document.createTextNode(text.slice(lastIndex, index)))
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const span = document.createElement('span')
|
|
107
|
+
span.className = props.highlightClass
|
|
108
|
+
span.textContent = matchText
|
|
109
|
+
fragment.appendChild(span)
|
|
110
|
+
|
|
111
|
+
lastIndex = index + matchText.length
|
|
112
|
+
hitCount++
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (lastIndex < text.length) {
|
|
116
|
+
fragment.appendChild(document.createTextNode(text.slice(lastIndex)))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
textNode.parentNode?.replaceChild(fragment, textNode)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return hitCount
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function scrollToFirstHighlight(root: HTMLElement): void {
|
|
126
|
+
const firstHighlight = root.querySelector<HTMLElement>(`.${props.highlightClass}`)
|
|
127
|
+
if (!firstHighlight) return
|
|
128
|
+
|
|
129
|
+
firstHighlight.scrollIntoView({
|
|
130
|
+
behavior: 'smooth',
|
|
131
|
+
block: 'center',
|
|
132
|
+
inline: 'nearest'
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function stopObserver(): void {
|
|
137
|
+
mutationObserver?.disconnect()
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function startObserver(): void {
|
|
141
|
+
const root = getRootElement()
|
|
142
|
+
if (!root) return
|
|
143
|
+
|
|
144
|
+
stopObserver()
|
|
145
|
+
|
|
146
|
+
mutationObserver = new MutationObserver(() => {
|
|
147
|
+
if (isApplyingHighlight) return
|
|
148
|
+
scheduleHighlight()
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
mutationObserver.observe(root, {
|
|
152
|
+
childList: true,
|
|
153
|
+
subtree: true,
|
|
154
|
+
characterData: true
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function scheduleHighlight(): void {
|
|
159
|
+
if (highlightTimeout) {
|
|
160
|
+
clearTimeout(highlightTimeout)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
highlightTimeout = setTimeout(() => {
|
|
164
|
+
void applySearchHighlight()
|
|
165
|
+
}, 0)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function applySearchHighlight(): Promise<void> {
|
|
169
|
+
const root = getRootElement()
|
|
170
|
+
if (!root || isApplyingHighlight) return
|
|
171
|
+
|
|
172
|
+
const rawSearchTarget = route.query[props.queryParam]
|
|
173
|
+
const searchTarget =
|
|
174
|
+
typeof rawSearchTarget === 'string'
|
|
175
|
+
? decodeURIComponent(rawSearchTarget).trim()
|
|
176
|
+
: ''
|
|
177
|
+
|
|
178
|
+
isApplyingHighlight = true
|
|
179
|
+
stopObserver()
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
removeHighlights(root)
|
|
183
|
+
|
|
184
|
+
if (!searchTarget) {
|
|
185
|
+
hasScrolledToHighlight = false
|
|
186
|
+
return
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
await nextTick()
|
|
190
|
+
|
|
191
|
+
const hitCount = highlightTextNodes(root, searchTarget)
|
|
192
|
+
|
|
193
|
+
if (hitCount > 0 && !hasScrolledToHighlight) {
|
|
194
|
+
await nextTick()
|
|
195
|
+
scrollToFirstHighlight(root)
|
|
196
|
+
hasScrolledToHighlight = true
|
|
197
|
+
}
|
|
198
|
+
} finally {
|
|
199
|
+
isApplyingHighlight = false
|
|
200
|
+
startObserver()
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
onMounted(async () => {
|
|
205
|
+
await nextTick()
|
|
206
|
+
startObserver()
|
|
207
|
+
await applySearchHighlight()
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
watch(
|
|
211
|
+
() => route.fullPath,
|
|
212
|
+
async () => {
|
|
213
|
+
hasScrolledToHighlight = false
|
|
214
|
+
await nextTick()
|
|
215
|
+
scheduleHighlight()
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
watch(
|
|
220
|
+
() => props.rootSelector,
|
|
221
|
+
async () => {
|
|
222
|
+
hasScrolledToHighlight = false
|
|
223
|
+
await nextTick()
|
|
224
|
+
startObserver()
|
|
225
|
+
scheduleHighlight()
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
onBeforeUnmount(() => {
|
|
230
|
+
stopObserver()
|
|
231
|
+
|
|
232
|
+
if (highlightTimeout) {
|
|
233
|
+
clearTimeout(highlightTimeout)
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
</script>
|
|
237
|
+
|
|
238
|
+
<template />
|
|
239
|
+
|
|
240
|
+
<style lang="scss">
|
|
241
|
+
@use "srl";
|
|
242
|
+
.searchTarget {
|
|
243
|
+
background-color: srl.colors-primary-1000();
|
|
244
|
+
color: srl.colors-white-1000();
|
|
245
|
+
padding: srl.spacer-get(50);
|
|
246
|
+
text-box-trim: trim-both;
|
|
247
|
+
border-radius: srl.spacer-get(50);
|
|
248
|
+
}
|
|
249
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"background-color": {
|
|
3
|
+
"label": "Background color",
|
|
4
|
+
"type": "select",
|
|
5
|
+
"options": [
|
|
6
|
+
{
|
|
7
|
+
"caption": "None"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"caption": "Primary",
|
|
11
|
+
"value": "srl-bg-primary-1000"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"caption": "Secondary",
|
|
15
|
+
"value": "srl-bg-secondary-1000"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"caption": "Tertiary",
|
|
19
|
+
"value": "srl-bg-tertiary-1000"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
CHANGED
package/scripts/config.js
CHANGED
|
@@ -29,18 +29,21 @@ export const baseComponentsToInstall = [
|
|
|
29
29
|
'090.Signatures/020.signature-item',
|
|
30
30
|
'100.Misc/010.anchor',
|
|
31
31
|
'110.PDF/010.pdf-pagebreak',
|
|
32
|
-
'110.PDF/030.pdf-
|
|
33
|
-
'110.PDF/
|
|
34
|
-
'110.PDF/
|
|
32
|
+
'110.PDF/030.pdf-cover',
|
|
33
|
+
'110.PDF/050.pdf-publication-title',
|
|
34
|
+
'110.PDF/060.pdf-chapter-title',
|
|
35
35
|
'110.PDF/080.pdf-toc-page',
|
|
36
36
|
'110.PDF/090.pdf-toc-item-title',
|
|
37
37
|
'110.PDF/100.pdf-toc-item',
|
|
38
|
+
'130.Hosting_Components/010.download-center',
|
|
39
|
+
'130.Hosting_Components/020.search',
|
|
38
40
|
'999.Properties/alignment',
|
|
41
|
+
'999.Properties/font-color',
|
|
42
|
+
'999.Properties/grid',
|
|
39
43
|
'999.Properties/hide-quote-characters',
|
|
40
44
|
'999.Properties/icon',
|
|
41
45
|
'999.Properties/pdf-spacer',
|
|
42
46
|
'999.Properties/reverse',
|
|
43
|
-
'999.Properties/grid',
|
|
44
47
|
];
|
|
45
48
|
|
|
46
49
|
export const nsWowInternalLddUrl = 'https://nswow-ld.nswow.ch/designs';
|
package/scss/colors/mixins.scss
CHANGED
package/scss/helpers/mixins.scss
CHANGED
|
@@ -41,6 +41,28 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
@mixin editor-label($text) {
|
|
45
|
+
position: relative;
|
|
46
|
+
&:after {
|
|
47
|
+
content: "#{$text}";
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
left: 0;
|
|
51
|
+
margin-top: 4px;
|
|
52
|
+
margin-left: 4px;
|
|
53
|
+
border: 1px solid;
|
|
54
|
+
padding: 2px 7px;
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
line-height: 1.2;
|
|
58
|
+
border-radius: 7px;
|
|
59
|
+
z-index: 10001;
|
|
60
|
+
color: rgb(148 148 148);
|
|
61
|
+
background: rgb(248 248 248);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
44
66
|
@mixin core-styles {
|
|
45
67
|
.#{variables.$class-prefix}list-reset {
|
|
46
68
|
@include list-reset;
|
package/scss/spacer/mixins.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
|
+
@use 'sass:list';
|
|
2
3
|
@use 'variables';
|
|
3
4
|
@use 'functions';
|
|
4
5
|
@use '../grid';
|
|
@@ -9,27 +10,53 @@
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
@mixin margin-block($spacer) {
|
|
12
|
-
|
|
13
|
+
@if system.$build == "word" {
|
|
14
|
+
margin-top: functions.get($spacer);
|
|
15
|
+
margin-bottom: functions.get($spacer);
|
|
16
|
+
} @else {
|
|
17
|
+
margin-block: functions.get($spacer);
|
|
18
|
+
}
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
@mixin margin-inline($spacer) {
|
|
16
|
-
|
|
22
|
+
@if system.$build == "word" {
|
|
23
|
+
margin-left: functions.get($spacer);
|
|
24
|
+
margin-right: functions.get($spacer);
|
|
25
|
+
} @else {
|
|
26
|
+
margin-inline: functions.get($spacer);
|
|
27
|
+
}
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
@mixin margin-top($spacer) {
|
|
20
|
-
|
|
31
|
+
@if system.$build == "word" {
|
|
32
|
+
margin-top: functions.get($spacer);
|
|
33
|
+
} @else {
|
|
34
|
+
margin-block-start: functions.get($spacer);
|
|
35
|
+
}
|
|
21
36
|
}
|
|
22
37
|
|
|
23
38
|
@mixin margin-right($spacer) {
|
|
24
|
-
|
|
39
|
+
@if system.$build == "word" {
|
|
40
|
+
margin-right: functions.get($spacer);
|
|
41
|
+
} @else {
|
|
42
|
+
margin-inline-end: functions.get($spacer);
|
|
43
|
+
}
|
|
25
44
|
}
|
|
26
45
|
|
|
27
46
|
@mixin margin-bottom($spacer) {
|
|
28
|
-
|
|
47
|
+
@if system.$build == "word" {
|
|
48
|
+
margin-bottom: functions.get($spacer);
|
|
49
|
+
} @else {
|
|
50
|
+
margin-block-end: functions.get($spacer);
|
|
51
|
+
}
|
|
29
52
|
}
|
|
30
53
|
|
|
31
54
|
@mixin margin-left($spacer) {
|
|
32
|
-
|
|
55
|
+
@if system.$build == "word" {
|
|
56
|
+
margin-left: functions.get($spacer);
|
|
57
|
+
} @else {
|
|
58
|
+
margin-inline-start: functions.get($spacer);
|
|
59
|
+
}
|
|
33
60
|
}
|
|
34
61
|
|
|
35
62
|
@mixin padding($spacer) {
|
|
@@ -37,27 +64,53 @@
|
|
|
37
64
|
}
|
|
38
65
|
|
|
39
66
|
@mixin padding-block($spacer) {
|
|
40
|
-
|
|
67
|
+
@if system.$build == "word" {
|
|
68
|
+
padding-top: functions.get($spacer);
|
|
69
|
+
padding-bottom: functions.get($spacer);
|
|
70
|
+
} @else {
|
|
71
|
+
padding-block: functions.get($spacer);
|
|
72
|
+
}
|
|
41
73
|
}
|
|
42
74
|
|
|
43
75
|
@mixin padding-inline($spacer) {
|
|
44
|
-
|
|
76
|
+
@if system.$build == "word" {
|
|
77
|
+
padding-left: functions.get($spacer);
|
|
78
|
+
padding-right: functions.get($spacer);
|
|
79
|
+
} @else {
|
|
80
|
+
padding-inline: functions.get($spacer);
|
|
81
|
+
}
|
|
45
82
|
}
|
|
46
83
|
|
|
47
84
|
@mixin padding-top($spacer) {
|
|
48
|
-
|
|
85
|
+
@if system.$build == "word" {
|
|
86
|
+
padding-top: functions.get($spacer);
|
|
87
|
+
} @else {
|
|
88
|
+
padding-block-start: functions.get($spacer);
|
|
89
|
+
}
|
|
49
90
|
}
|
|
50
91
|
|
|
51
92
|
@mixin padding-right($spacer) {
|
|
52
|
-
|
|
93
|
+
@if system.$build == "word" {
|
|
94
|
+
padding-right: functions.get($spacer);
|
|
95
|
+
} @else {
|
|
96
|
+
padding-inline-end: functions.get($spacer);
|
|
97
|
+
}
|
|
53
98
|
}
|
|
54
99
|
|
|
55
100
|
@mixin padding-bottom($spacer) {
|
|
56
|
-
|
|
101
|
+
@if system.$build == "word" {
|
|
102
|
+
padding-bottom: functions.get($spacer);
|
|
103
|
+
} @else {
|
|
104
|
+
padding-block-end: functions.get($spacer);
|
|
105
|
+
}
|
|
57
106
|
}
|
|
58
107
|
|
|
59
108
|
@mixin padding-left($spacer) {
|
|
60
|
-
|
|
109
|
+
@if system.$build == "word" {
|
|
110
|
+
padding-left: functions.get($spacer);
|
|
111
|
+
} @else {
|
|
112
|
+
padding-inline-start: functions.get($spacer);
|
|
113
|
+
}
|
|
61
114
|
}
|
|
62
115
|
|
|
63
116
|
@mixin gap($spacer) {
|
|
@@ -72,6 +125,62 @@
|
|
|
72
125
|
column-gap: functions.get($spacer);
|
|
73
126
|
}
|
|
74
127
|
|
|
128
|
+
@mixin component-margin($spacing-rules) {
|
|
129
|
+
@each $pair, $margin in $spacing-rules {
|
|
130
|
+
$from: list.nth($pair, 1);
|
|
131
|
+
$to: list.nth($pair, 2);
|
|
132
|
+
|
|
133
|
+
@if $to == '*' {
|
|
134
|
+
#{$from} + * {
|
|
135
|
+
@include margin-top($margin);
|
|
136
|
+
}
|
|
137
|
+
} @else {
|
|
138
|
+
#{$from} + #{$to} {
|
|
139
|
+
@include margin-top($margin);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@if system.$build == "pdf" {
|
|
144
|
+
@if $to == '*' {
|
|
145
|
+
#{$from} + *,
|
|
146
|
+
#{$from}-last + * {
|
|
147
|
+
@include margin-top($margin);
|
|
148
|
+
}
|
|
149
|
+
} @else {
|
|
150
|
+
#{$from} + #{$to},
|
|
151
|
+
#{$from} + #{$to}-first,
|
|
152
|
+
#{$from}-last + #{$to},
|
|
153
|
+
#{$from}-last + #{$to}-first {
|
|
154
|
+
@include margin-top($margin);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
} @else {
|
|
158
|
+
$wrappers: null;
|
|
159
|
+
|
|
160
|
+
@if system.$build != "xbrl" {
|
|
161
|
+
$wrappers: ('.srl-nested-container');
|
|
162
|
+
} @else {
|
|
163
|
+
$wrappers: ('.srl-nested-container', '.ixbrl-element');
|
|
164
|
+
}
|
|
165
|
+
@each $wrapper in $wrappers {
|
|
166
|
+
@if $to == '*' {
|
|
167
|
+
#{$from} + #{$wrapper}:has(:first-child),
|
|
168
|
+
#{$wrapper}:has(#{$from}:last-child) + * {
|
|
169
|
+
@include margin-top($margin);
|
|
170
|
+
}
|
|
171
|
+
} @else {
|
|
172
|
+
#{$from} + #{$wrapper}:has(#{$to}:first-child),
|
|
173
|
+
#{$wrapper}:has(#{$from}:last-child) + #{$to},
|
|
174
|
+
#{$wrapper}:has(#{$from}:first-child) + #{$wrapper}:has(#{$to}:last-child),
|
|
175
|
+
#{$wrapper}:has(#{$from}:last-child) + #{$wrapper}:has(#{$to}:first-child) {
|
|
176
|
+
@include margin-top($margin);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
75
184
|
@mixin core-styles {
|
|
76
185
|
@at-root {
|
|
77
186
|
@each $spacer, $spacerValue in variables.$spacer {
|
package/srl/srl/fa/index.scss
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
@return 900;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
@mixin content($icon, $style:
|
|
66
|
+
@mixin content($icon, $style: v.$default-style) {
|
|
67
67
|
@if not map.has-key(v.$brand-icons, $icon) and not map.has-key(v.$icons, $icon) {
|
|
68
68
|
@debug "Icon "#{$icon}" not found in Font Awesome 7.";
|
|
69
69
|
} @else {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
@mixin content-before($icon, $style:
|
|
91
|
+
@mixin content-before($icon, $style: v.$default-style) {
|
|
92
92
|
@if not map.has-key(v.$brand-icons, $icon) and not map.has-key(v.$icons, $icon) {
|
|
93
93
|
@debug "Icon "#{$icon}" not found in Font Awesome 7.";
|
|
94
94
|
} @else {
|
|
@@ -8,7 +8,4 @@
|
|
|
8
8
|
@forward "@fortawesome/fontawesome-free/scss/variables";
|
|
9
9
|
@forward "@fortawesome/fontawesome-free/scss/mixins";
|
|
10
10
|
$type: free;
|
|
11
|
-
$default-style:
|
|
12
|
-
@if map.has-key(meta.$meta, icon, default-style) {
|
|
13
|
-
$default-style: map.get(meta.$meta, icon, default-style);
|
|
14
|
-
}
|
|
11
|
+
$default-style: solid;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export interface PDFNestedContainerMarkerConfig {
|
|
2
|
+
selector?: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export class PDFNestedContainers {
|
|
6
|
+
private containers: NodeListOf<HTMLElement>;
|
|
7
|
+
|
|
8
|
+
private excludedClasses = [
|
|
9
|
+
'srl-grid',
|
|
10
|
+
'srl-linkable',
|
|
11
|
+
'srl-nested-container',
|
|
12
|
+
'srl-editor-component',
|
|
13
|
+
'srl-pdf-columnbreak',
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
private wrapperClasses = ['srl-grid'];
|
|
17
|
+
|
|
18
|
+
constructor(config: PDFNestedContainerMarkerConfig = {}) {
|
|
19
|
+
const { selector = '.srl-nested-container' } = config;
|
|
20
|
+
|
|
21
|
+
this.containers = document.querySelectorAll(selector);
|
|
22
|
+
|
|
23
|
+
if (this.containers.length === 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
this.markContainers();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private markContainers(): void {
|
|
31
|
+
this.containers.forEach((container) => {
|
|
32
|
+
const firstElement = this.findEdgeElement(container, 'first');
|
|
33
|
+
const lastElement = this.findEdgeElement(container, 'last');
|
|
34
|
+
|
|
35
|
+
const firstClass = firstElement
|
|
36
|
+
? this.getRelevantClass(firstElement)
|
|
37
|
+
: null;
|
|
38
|
+
const lastClass = lastElement ? this.getRelevantClass(lastElement) : null;
|
|
39
|
+
|
|
40
|
+
if (firstClass) {
|
|
41
|
+
container.classList.add(`${firstClass}-first`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (lastClass) {
|
|
45
|
+
container.classList.add(`${lastClass}-last`);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private findEdgeElement(
|
|
51
|
+
root: HTMLElement,
|
|
52
|
+
direction: 'first' | 'last',
|
|
53
|
+
): HTMLElement | null {
|
|
54
|
+
const children = Array.from(root.children) as HTMLElement[];
|
|
55
|
+
const orderedChildren =
|
|
56
|
+
direction === 'first' ? children : [...children].reverse();
|
|
57
|
+
|
|
58
|
+
for (const child of orderedChildren) {
|
|
59
|
+
const relevantClass = this.getRelevantClass(child);
|
|
60
|
+
|
|
61
|
+
if (relevantClass) {
|
|
62
|
+
return child;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (this.isLayoutWrapper(child)) {
|
|
66
|
+
const nestedElement = this.findEdgeElement(child, direction);
|
|
67
|
+
|
|
68
|
+
if (nestedElement) {
|
|
69
|
+
return nestedElement;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const nestedElement = this.findEdgeElement(child, direction);
|
|
76
|
+
|
|
77
|
+
if (nestedElement) {
|
|
78
|
+
return nestedElement;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private isLayoutWrapper(el: HTMLElement): boolean {
|
|
86
|
+
const classes = Array.from(el.classList);
|
|
87
|
+
|
|
88
|
+
if (classes.some((cls) => this.wrapperClasses.includes(cls))) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (classes.some((cls) => cls.includes('__'))) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (el.hasAttribute('doc-container') && !this.getRelevantClass(el)) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private getRelevantClass(el: HTMLElement): string | null {
|
|
104
|
+
const classes = Array.from(el.classList);
|
|
105
|
+
|
|
106
|
+
const relevant = classes.find((cls) => {
|
|
107
|
+
if (!cls.startsWith('srl-')) return false;
|
|
108
|
+
if (this.excludedClasses.includes(cls)) return false;
|
|
109
|
+
if (cls.includes('__')) return false;
|
|
110
|
+
if (this.wrapperClasses.includes(cls)) return false;
|
|
111
|
+
if (cls.endsWith('-first')) return false;
|
|
112
|
+
if (cls.endsWith('-last')) return false;
|
|
113
|
+
if (cls.startsWith('srl-text-alignment-')) return false;
|
|
114
|
+
|
|
115
|
+
return true;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return relevant || null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export default PDFNestedContainers;
|