@forsakringskassan/docs-live-example 1.3.0 → 1.4.0
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 +179 -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,
|
|
@@ -1507,7 +1624,6 @@ var import_vue2 = require("vue");
|
|
|
1507
1624
|
|
|
1508
1625
|
// src/utils/highlight.ts
|
|
1509
1626
|
var prettier = __toESM(require("prettier"));
|
|
1510
|
-
var import_parser_html = __toESM(require("prettier/parser-html"));
|
|
1511
1627
|
|
|
1512
1628
|
// node_modules/highlight.js/es/core.js
|
|
1513
1629
|
var import_core = __toESM(require_core(), 1);
|
|
@@ -1630,6 +1746,7 @@ function xml(hljs) {
|
|
|
1630
1746
|
relevance: 10
|
|
1631
1747
|
},
|
|
1632
1748
|
XML_ENTITIES,
|
|
1749
|
+
// xml processing instructions
|
|
1633
1750
|
{
|
|
1634
1751
|
className: "meta",
|
|
1635
1752
|
end: /\?>/,
|
|
@@ -1648,6 +1765,11 @@ function xml(hljs) {
|
|
|
1648
1765
|
},
|
|
1649
1766
|
{
|
|
1650
1767
|
className: "tag",
|
|
1768
|
+
/*
|
|
1769
|
+
The lookahead pattern (?=...) ensures that 'begin' only matches
|
|
1770
|
+
'<style' as a single word, followed by a whitespace or an
|
|
1771
|
+
ending bracket.
|
|
1772
|
+
*/
|
|
1651
1773
|
begin: /<style(?=\s|>)/,
|
|
1652
1774
|
end: />/,
|
|
1653
1775
|
keywords: { name: "style" },
|
|
@@ -1663,6 +1785,7 @@ function xml(hljs) {
|
|
|
1663
1785
|
},
|
|
1664
1786
|
{
|
|
1665
1787
|
className: "tag",
|
|
1788
|
+
// See the comment in the <style tag about the lookahead pattern
|
|
1666
1789
|
begin: /<script(?=\s|>)/,
|
|
1667
1790
|
end: />/,
|
|
1668
1791
|
keywords: { name: "script" },
|
|
@@ -1677,16 +1800,21 @@ function xml(hljs) {
|
|
|
1677
1800
|
]
|
|
1678
1801
|
}
|
|
1679
1802
|
},
|
|
1803
|
+
// we need this for now for jSX
|
|
1680
1804
|
{
|
|
1681
1805
|
className: "tag",
|
|
1682
1806
|
begin: /<>|<\/>/
|
|
1683
1807
|
},
|
|
1808
|
+
// open tag
|
|
1684
1809
|
{
|
|
1685
1810
|
className: "tag",
|
|
1686
1811
|
begin: regex.concat(
|
|
1687
1812
|
/</,
|
|
1688
1813
|
regex.lookahead(regex.concat(
|
|
1689
1814
|
TAG_NAME_RE,
|
|
1815
|
+
// <tag/>
|
|
1816
|
+
// <tag>
|
|
1817
|
+
// <tag ...
|
|
1690
1818
|
regex.either(/\/>/, />/, /\s/)
|
|
1691
1819
|
))
|
|
1692
1820
|
),
|
|
@@ -1700,6 +1828,7 @@ function xml(hljs) {
|
|
|
1700
1828
|
}
|
|
1701
1829
|
]
|
|
1702
1830
|
},
|
|
1831
|
+
// close tag
|
|
1703
1832
|
{
|
|
1704
1833
|
className: "tag",
|
|
1705
1834
|
begin: regex.concat(
|
|
@@ -1730,7 +1859,6 @@ function xml(hljs) {
|
|
|
1730
1859
|
core_default.registerLanguage("html", xml);
|
|
1731
1860
|
var prettierConfig = {
|
|
1732
1861
|
parser: "html",
|
|
1733
|
-
plugins: [import_parser_html.default],
|
|
1734
1862
|
singleQuote: false,
|
|
1735
1863
|
arrowParens: "always",
|
|
1736
1864
|
tabWidth: 4,
|
|
@@ -2030,11 +2158,23 @@ var _hoisted_3 = { class: "live-example__controls" };
|
|
|
2030
2158
|
var _hoisted_4 = { class: "live-example__code" };
|
|
2031
2159
|
var _hoisted_5 = { class: "live-example__code-toggle" };
|
|
2032
2160
|
var _hoisted_6 = ["aria-controls", "aria-expanded"];
|
|
2033
|
-
var _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2161
|
+
var _hoisted_7 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2162
|
+
"i",
|
|
2163
|
+
{ class: "icon icon--code" },
|
|
2164
|
+
null,
|
|
2165
|
+
-1
|
|
2166
|
+
/* HOISTED */
|
|
2167
|
+
));
|
|
2034
2168
|
var _hoisted_8 = ["id"];
|
|
2035
2169
|
var _hoisted_9 = { class: "live-example__code-languages" };
|
|
2036
2170
|
var _hoisted_10 = { class: "fieldset radio-button-group radio-button-group--horizontal" };
|
|
2037
|
-
var _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2171
|
+
var _hoisted_11 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ (0, import_vue3.createElementVNode)(
|
|
2172
|
+
"legend",
|
|
2173
|
+
{ class: "label fieldset__label" },
|
|
2174
|
+
"Kodspr\xE5k",
|
|
2175
|
+
-1
|
|
2176
|
+
/* HOISTED */
|
|
2177
|
+
));
|
|
2038
2178
|
var _hoisted_12 = { class: "fieldset__content radio-button-group__content" };
|
|
2039
2179
|
var _hoisted_13 = {
|
|
2040
2180
|
key: 0,
|
|
@@ -2049,14 +2189,20 @@ var _hoisted_19 = { ref: "template" };
|
|
|
2049
2189
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2050
2190
|
const _component_live_code = (0, import_vue3.resolveComponent)("live-code");
|
|
2051
2191
|
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("div", _hoisted_1, [
|
|
2052
|
-
(0, import_vue3.createElementVNode)(
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2192
|
+
(0, import_vue3.createElementVNode)(
|
|
2193
|
+
"div",
|
|
2194
|
+
_hoisted_2,
|
|
2195
|
+
[
|
|
2196
|
+
(0, import_vue3.createVNode)(_component_live_code, {
|
|
2197
|
+
components: _ctx.components,
|
|
2198
|
+
template: _ctx.template,
|
|
2199
|
+
livedata: _ctx.livedata,
|
|
2200
|
+
livemethods: _ctx.livemethods
|
|
2201
|
+
}, null, 8, ["components", "template", "livedata", "livemethods"])
|
|
2202
|
+
],
|
|
2203
|
+
512
|
|
2204
|
+
/* NEED_PATCH */
|
|
2205
|
+
),
|
|
2060
2206
|
(0, import_vue3.createElementVNode)("div", _hoisted_3, [
|
|
2061
2207
|
(0, import_vue3.renderSlot)(_ctx.$slots, "default", {}, void 0, true)
|
|
2062
2208
|
]),
|
|
@@ -2070,7 +2216,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2070
2216
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onToggleCode && _ctx.onToggleCode(...args))
|
|
2071
2217
|
}, [
|
|
2072
2218
|
_hoisted_7,
|
|
2073
|
-
(0, import_vue3.createTextVNode)(
|
|
2219
|
+
(0, import_vue3.createTextVNode)(
|
|
2220
|
+
" " + (0, import_vue3.toDisplayString)(_ctx.codeToggleText),
|
|
2221
|
+
1
|
|
2222
|
+
/* TEXT */
|
|
2223
|
+
)
|
|
2074
2224
|
], 8, _hoisted_6)
|
|
2075
2225
|
]),
|
|
2076
2226
|
(0, import_vue3.createElementVNode)("div", {
|
|
@@ -2117,7 +2267,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2117
2267
|
])
|
|
2118
2268
|
])
|
|
2119
2269
|
]),
|
|
2120
|
-
(0, import_vue3.createElementVNode)(
|
|
2270
|
+
(0, import_vue3.createElementVNode)(
|
|
2271
|
+
"pre",
|
|
2272
|
+
_hoisted_19,
|
|
2273
|
+
null,
|
|
2274
|
+
512
|
|
2275
|
+
/* NEED_PATCH */
|
|
2276
|
+
)
|
|
2121
2277
|
], 8, _hoisted_8)
|
|
2122
2278
|
])
|
|
2123
2279
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forsakringskassan/docs-live-example",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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",
|
|
35
|
+
"vue": "^3.4.15"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"html-validate": {
|