@forsakringskassan/docs-live-example 1.3.0 → 1.4.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/LiveCode.d.ts +1 -1
- package/dist/LiveExample.vue.d.ts +1 -1
- package/dist/index.js +181 -23
- package/package.json +3 -3
package/dist/LiveCode.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
type: ObjectConstructor;
|
|
16
16
|
required: true;
|
|
17
17
|
};
|
|
18
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
18
|
+
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
19
|
template: {
|
|
20
20
|
type: StringConstructor;
|
|
21
21
|
required: true;
|
|
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
34
34
|
compileCode(): void;
|
|
35
35
|
compileVue(): Promise<void>;
|
|
36
36
|
compileHTML(): Promise<void>;
|
|
37
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
37
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
38
|
template: {
|
|
39
39
|
type: StringConstructor;
|
|
40
40
|
required: true;
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
21
|
return to;
|
|
22
22
|
};
|
|
23
23
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
28
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
29
|
mod
|
|
26
30
|
));
|
|
@@ -28,7 +32,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
28
32
|
|
|
29
33
|
// node_modules/highlight.js/lib/core.js
|
|
30
34
|
var require_core = __commonJS({
|
|
31
|
-
"node_modules/highlight.js/lib/core.js"(
|
|
35
|
+
"node_modules/highlight.js/lib/core.js"(exports2, module2) {
|
|
32
36
|
function deepFreeze(obj) {
|
|
33
37
|
if (obj instanceof Map) {
|
|
34
38
|
obj.clear = obj.delete = obj.set = function() {
|
|
@@ -50,6 +54,9 @@ var require_core = __commonJS({
|
|
|
50
54
|
return obj;
|
|
51
55
|
}
|
|
52
56
|
var Response = class {
|
|
57
|
+
/**
|
|
58
|
+
* @param {CompiledMode} mode
|
|
59
|
+
*/
|
|
53
60
|
constructor(mode) {
|
|
54
61
|
if (mode.data === void 0)
|
|
55
62
|
mode.data = {};
|
|
@@ -73,7 +80,10 @@ var require_core = __commonJS({
|
|
|
73
80
|
result[key] = obj[key];
|
|
74
81
|
}
|
|
75
82
|
});
|
|
76
|
-
return
|
|
83
|
+
return (
|
|
84
|
+
/** @type {T} */
|
|
85
|
+
result
|
|
86
|
+
);
|
|
77
87
|
}
|
|
78
88
|
var SPAN_CLOSE = "</span>";
|
|
79
89
|
var emitsWrappingTags = (node) => {
|
|
@@ -93,14 +103,28 @@ var require_core = __commonJS({
|
|
|
93
103
|
return `${prefix}${name}`;
|
|
94
104
|
};
|
|
95
105
|
var HTMLRenderer = class {
|
|
106
|
+
/**
|
|
107
|
+
* Creates a new HTMLRenderer
|
|
108
|
+
*
|
|
109
|
+
* @param {Tree} parseTree - the parse tree (must support `walk` API)
|
|
110
|
+
* @param {{classPrefix: string}} options
|
|
111
|
+
*/
|
|
96
112
|
constructor(parseTree, options) {
|
|
97
113
|
this.buffer = "";
|
|
98
114
|
this.classPrefix = options.classPrefix;
|
|
99
115
|
parseTree.walk(this);
|
|
100
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Adds texts to the output stream
|
|
119
|
+
*
|
|
120
|
+
* @param {string} text */
|
|
101
121
|
addText(text) {
|
|
102
122
|
this.buffer += escapeHTML(text);
|
|
103
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Adds a node open to the output stream (if needed)
|
|
126
|
+
*
|
|
127
|
+
* @param {Node} node */
|
|
104
128
|
openNode(node) {
|
|
105
129
|
if (!emitsWrappingTags(node))
|
|
106
130
|
return;
|
|
@@ -110,14 +134,26 @@ var require_core = __commonJS({
|
|
|
110
134
|
);
|
|
111
135
|
this.span(className);
|
|
112
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Adds a node close to the output stream (if needed)
|
|
139
|
+
*
|
|
140
|
+
* @param {Node} node */
|
|
113
141
|
closeNode(node) {
|
|
114
142
|
if (!emitsWrappingTags(node))
|
|
115
143
|
return;
|
|
116
144
|
this.buffer += SPAN_CLOSE;
|
|
117
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* returns the accumulated buffer
|
|
148
|
+
*/
|
|
118
149
|
value() {
|
|
119
150
|
return this.buffer;
|
|
120
151
|
}
|
|
152
|
+
// helpers
|
|
153
|
+
/**
|
|
154
|
+
* Builds a span element
|
|
155
|
+
*
|
|
156
|
+
* @param {string} className */
|
|
121
157
|
span(className) {
|
|
122
158
|
this.buffer += `<span class="${className}">`;
|
|
123
159
|
}
|
|
@@ -127,7 +163,7 @@ var require_core = __commonJS({
|
|
|
127
163
|
Object.assign(result, opts);
|
|
128
164
|
return result;
|
|
129
165
|
};
|
|
130
|
-
var TokenTree = class {
|
|
166
|
+
var TokenTree = class _TokenTree {
|
|
131
167
|
constructor() {
|
|
132
168
|
this.rootNode = newNode();
|
|
133
169
|
this.stack = [this.rootNode];
|
|
@@ -138,9 +174,11 @@ var require_core = __commonJS({
|
|
|
138
174
|
get root() {
|
|
139
175
|
return this.rootNode;
|
|
140
176
|
}
|
|
177
|
+
/** @param {Node} node */
|
|
141
178
|
add(node) {
|
|
142
179
|
this.top.children.push(node);
|
|
143
180
|
}
|
|
181
|
+
/** @param {string} scope */
|
|
144
182
|
openNode(scope) {
|
|
145
183
|
const node = newNode({ scope });
|
|
146
184
|
this.add(node);
|
|
@@ -159,9 +197,17 @@ var require_core = __commonJS({
|
|
|
159
197
|
toJSON() {
|
|
160
198
|
return JSON.stringify(this.rootNode, null, 4);
|
|
161
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* @typedef { import("./html_renderer").Renderer } Renderer
|
|
202
|
+
* @param {Renderer} builder
|
|
203
|
+
*/
|
|
162
204
|
walk(builder) {
|
|
163
205
|
return this.constructor._walk(builder, this.rootNode);
|
|
164
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* @param {Renderer} builder
|
|
209
|
+
* @param {Node} node
|
|
210
|
+
*/
|
|
165
211
|
static _walk(builder, node) {
|
|
166
212
|
if (typeof node === "string") {
|
|
167
213
|
builder.addText(node);
|
|
@@ -172,6 +218,9 @@ var require_core = __commonJS({
|
|
|
172
218
|
}
|
|
173
219
|
return builder;
|
|
174
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* @param {Node} node
|
|
223
|
+
*/
|
|
175
224
|
static _collapse(node) {
|
|
176
225
|
if (typeof node === "string")
|
|
177
226
|
return;
|
|
@@ -181,28 +230,39 @@ var require_core = __commonJS({
|
|
|
181
230
|
node.children = [node.children.join("")];
|
|
182
231
|
} else {
|
|
183
232
|
node.children.forEach((child) => {
|
|
184
|
-
|
|
233
|
+
_TokenTree._collapse(child);
|
|
185
234
|
});
|
|
186
235
|
}
|
|
187
236
|
}
|
|
188
237
|
};
|
|
189
238
|
var TokenTreeEmitter = class extends TokenTree {
|
|
239
|
+
/**
|
|
240
|
+
* @param {*} options
|
|
241
|
+
*/
|
|
190
242
|
constructor(options) {
|
|
191
243
|
super();
|
|
192
244
|
this.options = options;
|
|
193
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* @param {string} text
|
|
248
|
+
*/
|
|
194
249
|
addText(text) {
|
|
195
250
|
if (text === "") {
|
|
196
251
|
return;
|
|
197
252
|
}
|
|
198
253
|
this.add(text);
|
|
199
254
|
}
|
|
255
|
+
/** @param {string} scope */
|
|
200
256
|
startScope(scope) {
|
|
201
257
|
this.openNode(scope);
|
|
202
258
|
}
|
|
203
259
|
endScope() {
|
|
204
260
|
this.closeNode();
|
|
205
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* @param {Emitter & {root: DataNode}} emitter
|
|
264
|
+
* @param {string} name
|
|
265
|
+
*/
|
|
206
266
|
__addSublanguage(emitter, name) {
|
|
207
267
|
const node = emitter.root;
|
|
208
268
|
if (name)
|
|
@@ -309,6 +369,7 @@ var require_core = __commonJS({
|
|
|
309
369
|
begin: beginShebang,
|
|
310
370
|
end: /$/,
|
|
311
371
|
relevance: 0,
|
|
372
|
+
/** @type {ModeCallback} */
|
|
312
373
|
"on:begin": (m, resp) => {
|
|
313
374
|
if (m.index !== 0)
|
|
314
375
|
resp.ignoreMatch();
|
|
@@ -348,12 +409,15 @@ var require_core = __commonJS({
|
|
|
348
409
|
);
|
|
349
410
|
mode.contains.push({
|
|
350
411
|
scope: "doctag",
|
|
412
|
+
// hack to avoid the space from being included. the space is necessary to
|
|
413
|
+
// match here to prevent the plain text rule below from gobbling up doctags
|
|
351
414
|
begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
|
|
352
415
|
end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
|
|
353
416
|
excludeBegin: true,
|
|
354
417
|
relevance: 0
|
|
355
418
|
});
|
|
356
419
|
const ENGLISH_WORD = either(
|
|
420
|
+
// list of common 1 and 2 letter words in English
|
|
357
421
|
"I",
|
|
358
422
|
"a",
|
|
359
423
|
"is",
|
|
@@ -365,19 +429,38 @@ var require_core = __commonJS({
|
|
|
365
429
|
"in",
|
|
366
430
|
"it",
|
|
367
431
|
"on",
|
|
432
|
+
// note: this is not an exhaustive list of contractions, just popular ones
|
|
368
433
|
/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
|
|
434
|
+
// contractions - can't we'd they're let's, etc
|
|
369
435
|
/[A-Za-z]+[-][a-z]+/,
|
|
436
|
+
// `no-way`, etc.
|
|
370
437
|
/[A-Za-z][a-z]{2,}/
|
|
438
|
+
// allow capitalized words at beginning of sentences
|
|
371
439
|
);
|
|
372
440
|
mode.contains.push(
|
|
373
441
|
{
|
|
442
|
+
// TODO: how to include ", (, ) without breaking grammars that use these for
|
|
443
|
+
// comment delimiters?
|
|
444
|
+
// begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
|
|
445
|
+
// ---
|
|
446
|
+
// this tries to find sequences of 3 english words in a row (without any
|
|
447
|
+
// "programming" type syntax) this gives us a strong signal that we've
|
|
448
|
+
// TRULY found a comment - vs perhaps scanning with the wrong language.
|
|
449
|
+
// It's possible to find something that LOOKS like the start of the
|
|
450
|
+
// comment - but then if there is no readable text - good chance it is a
|
|
451
|
+
// false match and not a comment.
|
|
452
|
+
//
|
|
453
|
+
// for a visual example please see:
|
|
454
|
+
// https://github.com/highlightjs/highlight.js/issues/2827
|
|
374
455
|
begin: concat(
|
|
375
456
|
/[ ]+/,
|
|
457
|
+
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
376
458
|
"(",
|
|
377
459
|
ENGLISH_WORD,
|
|
378
460
|
/[.]?[:]?([.][ ]|[ ])/,
|
|
379
461
|
"){3}"
|
|
380
462
|
)
|
|
463
|
+
// look for 3 words in a row
|
|
381
464
|
}
|
|
382
465
|
);
|
|
383
466
|
return mode;
|
|
@@ -425,6 +508,7 @@ var require_core = __commonJS({
|
|
|
425
508
|
relevance: 0
|
|
426
509
|
};
|
|
427
510
|
var METHOD_GUARD = {
|
|
511
|
+
// excludes method names from keyword processing
|
|
428
512
|
begin: "\\.\\s*" + UNDERSCORE_IDENT_RE,
|
|
429
513
|
relevance: 0
|
|
430
514
|
};
|
|
@@ -432,9 +516,11 @@ var require_core = __commonJS({
|
|
|
432
516
|
return Object.assign(
|
|
433
517
|
mode,
|
|
434
518
|
{
|
|
519
|
+
/** @type {ModeCallback} */
|
|
435
520
|
"on:begin": (m, resp) => {
|
|
436
521
|
resp.data._beginMatch = m[1];
|
|
437
522
|
},
|
|
523
|
+
/** @type {ModeCallback} */
|
|
438
524
|
"on:end": (m, resp) => {
|
|
439
525
|
if (resp.data._beginMatch !== m[1])
|
|
440
526
|
resp.ignoreMatch();
|
|
@@ -540,8 +626,11 @@ var require_core = __commonJS({
|
|
|
540
626
|
"if",
|
|
541
627
|
"then",
|
|
542
628
|
"parent",
|
|
629
|
+
// common variable name
|
|
543
630
|
"list",
|
|
631
|
+
// common variable name
|
|
544
632
|
"value"
|
|
633
|
+
// common variable name
|
|
545
634
|
];
|
|
546
635
|
var DEFAULT_KEYWORD_SCOPE = "keyword";
|
|
547
636
|
function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {
|
|
@@ -665,6 +754,7 @@ var require_core = __commonJS({
|
|
|
665
754
|
this.matchAt = 1;
|
|
666
755
|
this.position = 0;
|
|
667
756
|
}
|
|
757
|
+
// @ts-ignore
|
|
668
758
|
addRule(re, opts) {
|
|
669
759
|
opts.position = this.position++;
|
|
670
760
|
this.matchIndexes[this.matchAt] = opts;
|
|
@@ -679,6 +769,7 @@ var require_core = __commonJS({
|
|
|
679
769
|
this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: "|" }), true);
|
|
680
770
|
this.lastIndex = 0;
|
|
681
771
|
}
|
|
772
|
+
/** @param {string} s */
|
|
682
773
|
exec(s) {
|
|
683
774
|
this.matcherRe.lastIndex = this.lastIndex;
|
|
684
775
|
const match = this.matcherRe.exec(s);
|
|
@@ -699,6 +790,7 @@ var require_core = __commonJS({
|
|
|
699
790
|
this.lastIndex = 0;
|
|
700
791
|
this.regexIndex = 0;
|
|
701
792
|
}
|
|
793
|
+
// @ts-ignore
|
|
702
794
|
getMatcher(index) {
|
|
703
795
|
if (this.multiRegexes[index])
|
|
704
796
|
return this.multiRegexes[index];
|
|
@@ -714,11 +806,13 @@ var require_core = __commonJS({
|
|
|
714
806
|
considerAll() {
|
|
715
807
|
this.regexIndex = 0;
|
|
716
808
|
}
|
|
809
|
+
// @ts-ignore
|
|
717
810
|
addRule(re, opts) {
|
|
718
811
|
this.rules.push([re, opts]);
|
|
719
812
|
if (opts.type === "begin")
|
|
720
813
|
this.count++;
|
|
721
814
|
}
|
|
815
|
+
/** @param {string} s */
|
|
722
816
|
exec(s) {
|
|
723
817
|
const m = this.getMatcher(this.regexIndex);
|
|
724
818
|
m.lastIndex = this.lastIndex;
|
|
@@ -753,11 +847,16 @@ var require_core = __commonJS({
|
|
|
753
847
|
return mm;
|
|
754
848
|
}
|
|
755
849
|
function compileMode(mode, parent) {
|
|
756
|
-
const cmode =
|
|
850
|
+
const cmode = (
|
|
851
|
+
/** @type CompiledMode */
|
|
852
|
+
mode
|
|
853
|
+
);
|
|
757
854
|
if (mode.isCompiled)
|
|
758
855
|
return cmode;
|
|
759
856
|
[
|
|
760
857
|
scopeClassName,
|
|
858
|
+
// do this early so compiler extensions generally don't have to worry about
|
|
859
|
+
// the distinction between match/begin
|
|
761
860
|
compileMatch,
|
|
762
861
|
MultiClass,
|
|
763
862
|
beforeMatchExt
|
|
@@ -766,7 +865,10 @@ var require_core = __commonJS({
|
|
|
766
865
|
mode.__beforeBegin = null;
|
|
767
866
|
[
|
|
768
867
|
beginKeywords,
|
|
868
|
+
// do this later so compiler extensions that come earlier have access to the
|
|
869
|
+
// raw array if they wanted to perhaps manipulate it, etc.
|
|
769
870
|
compileIllegal,
|
|
871
|
+
// default to 1 relevance if not specified
|
|
770
872
|
compileRelevance
|
|
771
873
|
].forEach((ext) => ext(mode, parent));
|
|
772
874
|
mode.isCompiled = true;
|
|
@@ -795,14 +897,21 @@ var require_core = __commonJS({
|
|
|
795
897
|
}
|
|
796
898
|
}
|
|
797
899
|
if (mode.illegal)
|
|
798
|
-
cmode.illegalRe = langRe(
|
|
900
|
+
cmode.illegalRe = langRe(
|
|
901
|
+
/** @type {RegExp | string} */
|
|
902
|
+
mode.illegal
|
|
903
|
+
);
|
|
799
904
|
if (!mode.contains)
|
|
800
905
|
mode.contains = [];
|
|
801
906
|
mode.contains = [].concat(...mode.contains.map(function(c) {
|
|
802
907
|
return expandOrCloneMode(c === "self" ? mode : c);
|
|
803
908
|
}));
|
|
804
909
|
mode.contains.forEach(function(c) {
|
|
805
|
-
compileMode(
|
|
910
|
+
compileMode(
|
|
911
|
+
/** @type Mode */
|
|
912
|
+
c,
|
|
913
|
+
cmode
|
|
914
|
+
);
|
|
806
915
|
});
|
|
807
916
|
if (mode.starts) {
|
|
808
917
|
compileMode(mode.starts, parent);
|
|
@@ -816,7 +925,10 @@ var require_core = __commonJS({
|
|
|
816
925
|
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
817
926
|
}
|
|
818
927
|
language.classNameAliases = inherit$1(language.classNameAliases || {});
|
|
819
|
-
return compileMode(
|
|
928
|
+
return compileMode(
|
|
929
|
+
/** @type Mode */
|
|
930
|
+
language
|
|
931
|
+
);
|
|
820
932
|
}
|
|
821
933
|
function dependencyOnParent(mode) {
|
|
822
934
|
if (!mode)
|
|
@@ -867,6 +979,8 @@ var require_core = __commonJS({
|
|
|
867
979
|
classPrefix: "hljs-",
|
|
868
980
|
cssSelector: "pre code",
|
|
869
981
|
languages: null,
|
|
982
|
+
// beta configuration options, subject to change, welcome to discuss
|
|
983
|
+
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
870
984
|
__emitter: TokenTreeEmitter
|
|
871
985
|
};
|
|
872
986
|
function shouldNotHighlight(languageName) {
|
|
@@ -962,7 +1076,8 @@ var require_core = __commonJS({
|
|
|
962
1076
|
return;
|
|
963
1077
|
}
|
|
964
1078
|
result2 = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);
|
|
965
|
-
continuations[top.subLanguage] =
|
|
1079
|
+
continuations[top.subLanguage] = /** @type {CompiledMode} */
|
|
1080
|
+
result2._top;
|
|
966
1081
|
} else {
|
|
967
1082
|
result2 = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);
|
|
968
1083
|
}
|
|
@@ -1321,6 +1436,7 @@ var require_core = __commonJS({
|
|
|
1321
1436
|
updateClassName(element, language, result.language);
|
|
1322
1437
|
element.result = {
|
|
1323
1438
|
language: result.language,
|
|
1439
|
+
// TODO: remove with version 11.0
|
|
1324
1440
|
re: result.relevance,
|
|
1325
1441
|
relevance: result.relevance
|
|
1326
1442
|
};
|
|
@@ -1451,6 +1567,7 @@ var require_core = __commonJS({
|
|
|
1451
1567
|
highlightAuto,
|
|
1452
1568
|
highlightAll,
|
|
1453
1569
|
highlightElement,
|
|
1570
|
+
// TODO: Remove with v12 API
|
|
1454
1571
|
highlightBlock: deprecateHighlightBlock,
|
|
1455
1572
|
configure,
|
|
1456
1573
|
initHighlighting,
|
|
@@ -1506,7 +1623,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
1506
1623
|
var import_vue2 = require("vue");
|
|
1507
1624
|
|
|
1508
1625
|
// src/utils/highlight.ts
|
|
1509
|
-
var
|
|
1626
|
+
var import_standalone = __toESM(require("prettier/standalone"));
|
|
1510
1627
|
var import_parser_html = __toESM(require("prettier/parser-html"));
|
|
1511
1628
|
|
|
1512
1629
|
// node_modules/highlight.js/es/core.js
|
|
@@ -1630,6 +1747,7 @@ function xml(hljs) {
|
|
|
1630
1747
|
relevance: 10
|
|
1631
1748
|
},
|
|
1632
1749
|
XML_ENTITIES,
|
|
1750
|
+
// xml processing instructions
|
|
1633
1751
|
{
|
|
1634
1752
|
className: "meta",
|
|
1635
1753
|
end: /\?>/,
|
|
@@ -1648,6 +1766,11 @@ function xml(hljs) {
|
|
|
1648
1766
|
},
|
|
1649
1767
|
{
|
|
1650
1768
|
className: "tag",
|
|
1769
|
+
/*
|
|
1770
|
+
The lookahead pattern (?=...) ensures that 'begin' only matches
|
|
1771
|
+
'<style' as a single word, followed by a whitespace or an
|
|
1772
|
+
ending bracket.
|
|
1773
|
+
*/
|
|
1651
1774
|
begin: /<style(?=\s|>)/,
|
|
1652
1775
|
end: />/,
|
|
1653
1776
|
keywords: { name: "style" },
|
|
@@ -1663,6 +1786,7 @@ function xml(hljs) {
|
|
|
1663
1786
|
},
|
|
1664
1787
|
{
|
|
1665
1788
|
className: "tag",
|
|
1789
|
+
// See the comment in the <style tag about the lookahead pattern
|
|
1666
1790
|
begin: /<script(?=\s|>)/,
|
|
1667
1791
|
end: />/,
|
|
1668
1792
|
keywords: { name: "script" },
|
|
@@ -1677,16 +1801,21 @@ function xml(hljs) {
|
|
|
1677
1801
|
]
|
|
1678
1802
|
}
|
|
1679
1803
|
},
|
|
1804
|
+
// we need this for now for jSX
|
|
1680
1805
|
{
|
|
1681
1806
|
className: "tag",
|
|
1682
1807
|
begin: /<>|<\/>/
|
|
1683
1808
|
},
|
|
1809
|
+
// open tag
|
|
1684
1810
|
{
|
|
1685
1811
|
className: "tag",
|
|
1686
1812
|
begin: regex.concat(
|
|
1687
1813
|
/</,
|
|
1688
1814
|
regex.lookahead(regex.concat(
|
|
1689
1815
|
TAG_NAME_RE,
|
|
1816
|
+
// <tag/>
|
|
1817
|
+
// <tag>
|
|
1818
|
+
// <tag ...
|
|
1690
1819
|
regex.either(/\/>/, />/, /\s/)
|
|
1691
1820
|
))
|
|
1692
1821
|
),
|
|
@@ -1700,6 +1829,7 @@ function xml(hljs) {
|
|
|
1700
1829
|
}
|
|
1701
1830
|
]
|
|
1702
1831
|
},
|
|
1832
|
+
// close tag
|
|
1703
1833
|
{
|
|
1704
1834
|
className: "tag",
|
|
1705
1835
|
begin: regex.concat(
|
|
@@ -1737,7 +1867,7 @@ var prettierConfig = {
|
|
|
1737
1867
|
printWidth: 80
|
|
1738
1868
|
};
|
|
1739
1869
|
async function highlight(code) {
|
|
1740
|
-
const formatted = await
|
|
1870
|
+
const formatted = await import_standalone.default.format(code, prettierConfig);
|
|
1741
1871
|
const { value } = core_default.highlight(formatted, { language: "html" });
|
|
1742
1872
|
return `<code class="hljs lang-html" tabindex="0">${value}</code>`;
|
|
1743
1873
|
}
|
|
@@ -2030,11 +2160,23 @@ var _hoisted_3 = { class: "live-example__controls" };
|
|
|
2030
2160
|
var _hoisted_4 = { class: "live-example__code" };
|
|
2031
2161
|
var _hoisted_5 = { class: "live-example__code-toggle" };
|
|
2032
2162
|
var _hoisted_6 = ["aria-controls", "aria-expanded"];
|
|
2033
|
-
var _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2163
|
+
var _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2164
|
+
"i",
|
|
2165
|
+
{ class: "icon icon--code" },
|
|
2166
|
+
null,
|
|
2167
|
+
-1
|
|
2168
|
+
/* HOISTED */
|
|
2169
|
+
));
|
|
2034
2170
|
var _hoisted_8 = ["id"];
|
|
2035
2171
|
var _hoisted_9 = { class: "live-example__code-languages" };
|
|
2036
2172
|
var _hoisted_10 = { class: "fieldset radio-button-group radio-button-group--horizontal" };
|
|
2037
|
-
var _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2173
|
+
var _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2174
|
+
"legend",
|
|
2175
|
+
{ class: "label fieldset__label" },
|
|
2176
|
+
"Kodspr\xE5k",
|
|
2177
|
+
-1
|
|
2178
|
+
/* HOISTED */
|
|
2179
|
+
));
|
|
2038
2180
|
var _hoisted_12 = { class: "fieldset__content radio-button-group__content" };
|
|
2039
2181
|
var _hoisted_13 = {
|
|
2040
2182
|
key: 0,
|
|
@@ -2049,14 +2191,20 @@ var _hoisted_19 = { ref: "template" };
|
|
|
2049
2191
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2050
2192
|
const _component_live_code = (0, import_vue3.resolveComponent)("live-code");
|
|
2051
2193
|
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("div", _hoisted_1, [
|
|
2052
|
-
(0, import_vue3.createElementVNode)(
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2194
|
+
(0, import_vue3.createElementVNode)(
|
|
2195
|
+
"div",
|
|
2196
|
+
_hoisted_2,
|
|
2197
|
+
[
|
|
2198
|
+
(0, import_vue3.createVNode)(_component_live_code, {
|
|
2199
|
+
components: _ctx.components,
|
|
2200
|
+
template: _ctx.template,
|
|
2201
|
+
livedata: _ctx.livedata,
|
|
2202
|
+
livemethods: _ctx.livemethods
|
|
2203
|
+
}, null, 8, ["components", "template", "livedata", "livemethods"])
|
|
2204
|
+
],
|
|
2205
|
+
512
|
|
2206
|
+
/* NEED_PATCH */
|
|
2207
|
+
),
|
|
2060
2208
|
(0, import_vue3.createElementVNode)("div", _hoisted_3, [
|
|
2061
2209
|
(0, import_vue3.renderSlot)(_ctx.$slots, "default", {}, void 0, true)
|
|
2062
2210
|
]),
|
|
@@ -2070,7 +2218,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2070
2218
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onToggleCode && _ctx.onToggleCode(...args))
|
|
2071
2219
|
}, [
|
|
2072
2220
|
_hoisted_7,
|
|
2073
|
-
(0, import_vue3.createTextVNode)(
|
|
2221
|
+
(0, import_vue3.createTextVNode)(
|
|
2222
|
+
" " + (0, import_vue3.toDisplayString)(_ctx.codeToggleText),
|
|
2223
|
+
1
|
|
2224
|
+
/* TEXT */
|
|
2225
|
+
)
|
|
2074
2226
|
], 8, _hoisted_6)
|
|
2075
2227
|
]),
|
|
2076
2228
|
(0, import_vue3.createElementVNode)("div", {
|
|
@@ -2117,7 +2269,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2117
2269
|
])
|
|
2118
2270
|
])
|
|
2119
2271
|
]),
|
|
2120
|
-
(0, import_vue3.createElementVNode)(
|
|
2272
|
+
(0, import_vue3.createElementVNode)(
|
|
2273
|
+
"pre",
|
|
2274
|
+
_hoisted_19,
|
|
2275
|
+
null,
|
|
2276
|
+
512
|
|
2277
|
+
/* NEED_PATCH */
|
|
2278
|
+
)
|
|
2121
2279
|
], 8, _hoisted_8)
|
|
2122
2280
|
])
|
|
2123
2281
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/docs-live-example",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Components used for live examples",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"html-validate": ">= 7.9.0",
|
|
34
|
-
"prettier": "2.
|
|
35
|
-
"vue": "^3"
|
|
34
|
+
"prettier": "^2.3 || ^3",
|
|
35
|
+
"vue": "^3.4.15"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"html-validate": {
|