@pacem/pacem-ui 1.0.6-ricci → 2.0.0-abel
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/browser/pacem-ui.js +14 -183
- package/dist/browser/pacem-ui.js.map +1 -1
- package/dist/browser/pacem-ui.min.js +2 -2
- package/dist/bundle/pacem-ui.min.mjs +75 -75
- package/dist/bundle/pacem-ui.mjs +11 -239
- package/dist/bundle/pacem-ui.mjs.map +3 -3
- package/dist/docs/pacem-ui.json +1 -16
- package/dist/esm/adapter.js +1 -1
- package/dist/esm/anchor.js +1 -1
- package/dist/esm/balloon.js +1 -1
- package/dist/esm/binder.js +1 -1
- package/dist/esm/blade.js +1 -1
- package/dist/esm/bottom-sheet.js +1 -1
- package/dist/esm/button.js +1 -1
- package/dist/esm/buttonset.js +1 -1
- package/dist/esm/calendar.js +1 -1
- package/dist/esm/collapse.js +1 -1
- package/dist/esm/dialog-abstractions.js +1 -1
- package/dist/esm/dialog.js +1 -1
- package/dist/esm/divider.js +1 -1
- package/dist/esm/icon.js +1 -1
- package/dist/esm/image.js +1 -1
- package/dist/esm/index-components-ui.js +1 -1
- package/dist/esm/index-components.js +1 -1
- package/dist/esm/index-iife.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/infinite-scroller.js +1 -1
- package/dist/esm/iterative.js +1 -1
- package/dist/esm/lightbox-abstractions.js +1 -1
- package/dist/esm/lightbox.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/markdown-svc.js +14 -183
- package/dist/esm/markdown.js +1 -1
- package/dist/esm/marquee.js +1 -1
- package/dist/esm/media-query.js +1 -1
- package/dist/esm/menu.js +1 -1
- package/dist/esm/pager.js +1 -1
- package/dist/esm/picture.js +1 -1
- package/dist/esm/progressbar.js +1 -1
- package/dist/esm/sidebar.js +1 -1
- package/dist/esm/slideshow.js +1 -1
- package/dist/esm/social-twitter.js +1 -1
- package/dist/esm/sticky-header.js +1 -1
- package/dist/esm/tabs.js +1 -1
- package/dist/esm/ticker.js +1 -1
- package/dist/esm/toast.js +1 -1
- package/dist/esm/toc.js +1 -1
- package/dist/esm/tuner.js +1 -1
- package/dist/esm/types.js +1 -1
- package/dist/esm/vibration.js +1 -1
- package/dist/esm/view.js +1 -1
- package/dist/esm/window.js +1 -1
- package/package.json +1 -1
- package/typings/index.d.ts +5 -2
package/dist/bundle/pacem-ui.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @pacem/pacem-ui
|
|
2
|
+
* @pacem/pacem-ui v2.0.0-abel (https://js.pacem.it)
|
|
3
3
|
* Pacem (https://pacem.it)
|
|
4
4
|
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
@@ -3429,8 +3429,8 @@ __decorate15([
|
|
|
3429
3429
|
converter: {
|
|
3430
3430
|
convert: (attr, el) => {
|
|
3431
3431
|
const regex = /^\s*([\d.]+)(px|em|rem|vw|vh)?\s*(?:,\s*([\d.]+)(px|em|rem|vw|vh)?)?\s*$/i;
|
|
3432
|
-
const
|
|
3433
|
-
const width =
|
|
3432
|
+
const match = regex.exec(attr);
|
|
3433
|
+
const width = match ? match[1] + (match[2] || "px") : "0", height = match ? match[3] ? match[3] + (match[4] || "px") : width : "0";
|
|
3434
3434
|
return { width, height };
|
|
3435
3435
|
},
|
|
3436
3436
|
convertBack: (prop, el) => `${prop?.width},${prop?.height}`
|
|
@@ -3943,205 +3943,6 @@ import { P as P19, CustomElement as CustomElement18, Watch as Watch19, PropertyC
|
|
|
3943
3943
|
// packages/ui/dist/esm/markdown-svc.js
|
|
3944
3944
|
import { Compile } from "@pacem/pacem-foundation";
|
|
3945
3945
|
import { P as P18 } from "@pacem/pacem-core";
|
|
3946
|
-
var match = (input, pattern, fn) => {
|
|
3947
|
-
const arr = pattern.exec(input);
|
|
3948
|
-
if (arr && arr.length) {
|
|
3949
|
-
return fn(arr);
|
|
3950
|
-
}
|
|
3951
|
-
return null;
|
|
3952
|
-
};
|
|
3953
|
-
var MARKUP_RULES = [
|
|
3954
|
-
{
|
|
3955
|
-
// comment
|
|
3956
|
-
exec: (input) => match(input, /^((<|<)!--(?:(?!(--(>|>)))[\s\S])*(--(?:>|>)|$))/, (arr) => {
|
|
3957
|
-
const raw = arr[0], text = raw;
|
|
3958
|
-
return [{
|
|
3959
|
-
type: "code-comment",
|
|
3960
|
-
raw,
|
|
3961
|
-
text,
|
|
3962
|
-
index: arr.index
|
|
3963
|
-
}];
|
|
3964
|
-
})
|
|
3965
|
-
},
|
|
3966
|
-
{
|
|
3967
|
-
// opening/self-closing tag
|
|
3968
|
-
exec: (input, lexer) => match(input, /^(<|<)([\w-]+)(?:\s+[\w-]+(?:=(?:'[^']*'|"[^"]*"))*)*(\s*\/?(?:>|>))/, (arr) => {
|
|
3969
|
-
const openingTag = arr[1], tagName = arr[2], closingTag = arr[3];
|
|
3970
|
-
const closingTagIndex = arr[0].length - closingTag.length, attributesIndex = openingTag.length + tagName.length, attributesString = input.substring(attributesIndex, closingTagIndex);
|
|
3971
|
-
const attributes = lexer.tokenize(attributesString, [{
|
|
3972
|
-
exec: (input2) => match(input2, /^(\s+[\w-]+)(=('[^']*'|"[^"]*"))?/, (arr2) => {
|
|
3973
|
-
const raw = arr2[1];
|
|
3974
|
-
const output = [{
|
|
3975
|
-
type: "code-attribute",
|
|
3976
|
-
raw,
|
|
3977
|
-
text: raw,
|
|
3978
|
-
index: arr2[0].indexOf(raw)
|
|
3979
|
-
}];
|
|
3980
|
-
if (arr2.length > 2) {
|
|
3981
|
-
output.push({
|
|
3982
|
-
type: "code-string",
|
|
3983
|
-
raw: arr2[2],
|
|
3984
|
-
text: arr2[2],
|
|
3985
|
-
index: arr2.index + arr2[0].length - arr2[2].length
|
|
3986
|
-
});
|
|
3987
|
-
}
|
|
3988
|
-
return output;
|
|
3989
|
-
})
|
|
3990
|
-
}]);
|
|
3991
|
-
const retval = [{
|
|
3992
|
-
type: "code-tag",
|
|
3993
|
-
raw: openingTag,
|
|
3994
|
-
text: openingTag,
|
|
3995
|
-
index: 0
|
|
3996
|
-
}, {
|
|
3997
|
-
type: "code-tagname",
|
|
3998
|
-
raw: tagName,
|
|
3999
|
-
text: tagName,
|
|
4000
|
-
index: openingTag.length
|
|
4001
|
-
}];
|
|
4002
|
-
Array.prototype.push.apply(retval, attributes);
|
|
4003
|
-
retval.push({
|
|
4004
|
-
type: "code-tag",
|
|
4005
|
-
raw: closingTag,
|
|
4006
|
-
text: closingTag,
|
|
4007
|
-
index: closingTagIndex
|
|
4008
|
-
});
|
|
4009
|
-
return retval;
|
|
4010
|
-
})
|
|
4011
|
-
},
|
|
4012
|
-
{
|
|
4013
|
-
// closing tag
|
|
4014
|
-
exec: (input) => match(input, /^((?:<|<)\/)([\w-]+)(\s*(?:>|>))/, (arr) => {
|
|
4015
|
-
const openingTag = arr[1], tagName = arr[2], closingTag = arr[3];
|
|
4016
|
-
return [{
|
|
4017
|
-
type: "code-tag",
|
|
4018
|
-
raw: openingTag,
|
|
4019
|
-
text: openingTag,
|
|
4020
|
-
index: 0
|
|
4021
|
-
}, {
|
|
4022
|
-
type: "code-tagname",
|
|
4023
|
-
raw: tagName,
|
|
4024
|
-
text: tagName,
|
|
4025
|
-
index: openingTag.length
|
|
4026
|
-
}, {
|
|
4027
|
-
type: "code-tag",
|
|
4028
|
-
raw: closingTag,
|
|
4029
|
-
text: closingTag,
|
|
4030
|
-
index: arr.index + arr[0].length - closingTag.length
|
|
4031
|
-
}];
|
|
4032
|
-
})
|
|
4033
|
-
},
|
|
4034
|
-
{
|
|
4035
|
-
// text
|
|
4036
|
-
exec: (input) => match(input, /^(<|<)?((?!<|<).)+/, (arr) => {
|
|
4037
|
-
const raw = arr[0], text = raw;
|
|
4038
|
-
return [{
|
|
4039
|
-
type: "text",
|
|
4040
|
-
raw,
|
|
4041
|
-
text
|
|
4042
|
-
}];
|
|
4043
|
-
})
|
|
4044
|
-
}
|
|
4045
|
-
];
|
|
4046
|
-
var C_LIKE_RULES = [{
|
|
4047
|
-
// comments
|
|
4048
|
-
exec: (input, _) => match(input, /^\/\/.*/, (arr) => {
|
|
4049
|
-
const raw = arr[0], text = raw;
|
|
4050
|
-
return [{
|
|
4051
|
-
type: "code-comment",
|
|
4052
|
-
raw,
|
|
4053
|
-
text
|
|
4054
|
-
}];
|
|
4055
|
-
})
|
|
4056
|
-
}, {
|
|
4057
|
-
exec: (input, _) => match(input, /^\/\*(?:(?!(\*\/))[\s\S])*(?:\*\/|$)/, (arr) => {
|
|
4058
|
-
const raw = arr[0], text = raw;
|
|
4059
|
-
return [{
|
|
4060
|
-
type: "code-comment",
|
|
4061
|
-
raw,
|
|
4062
|
-
text
|
|
4063
|
-
}];
|
|
4064
|
-
})
|
|
4065
|
-
}, {
|
|
4066
|
-
// string literal
|
|
4067
|
-
exec: (input, _) => match(input, /^('(\\'|[^'])*[^\\]?'|@?\$?"(\\"|[^"])*[^\\]?")/, (arr) => {
|
|
4068
|
-
const raw = arr[0], text = raw;
|
|
4069
|
-
return [{
|
|
4070
|
-
type: "code-string",
|
|
4071
|
-
raw,
|
|
4072
|
-
text
|
|
4073
|
-
}];
|
|
4074
|
-
})
|
|
4075
|
-
}, {
|
|
4076
|
-
// keywords
|
|
4077
|
-
exec: (input, _) => match(input, /^\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|static|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|nameof|orderby|partial|remove|select|set|value|var|when|where|yield)\b/, (arr) => {
|
|
4078
|
-
const raw = arr[0], text = raw;
|
|
4079
|
-
return [{
|
|
4080
|
-
type: "code-keyword",
|
|
4081
|
-
raw,
|
|
4082
|
-
text
|
|
4083
|
-
}];
|
|
4084
|
-
})
|
|
4085
|
-
}, {
|
|
4086
|
-
// number
|
|
4087
|
-
exec: (input, _) => match(input, /^\b((0x[0-9a-fA-F]|[\d])*\.?[\d]+)\b/, (arr) => {
|
|
4088
|
-
const raw = arr[0], text = raw;
|
|
4089
|
-
return [{
|
|
4090
|
-
type: "code-number",
|
|
4091
|
-
raw,
|
|
4092
|
-
text
|
|
4093
|
-
}];
|
|
4094
|
-
})
|
|
4095
|
-
}, {
|
|
4096
|
-
// variables, operators, parentheses
|
|
4097
|
-
exec: (input, _) => match(input, /^(@?\w+|:|\?\??|\?=?|\|\|?|&&?|&=?|;|,|=|\*=?|--|-=?|\+\+|\+=?|\/=?|\^|\(|\[|\)|\]|\{|\})/, (arr) => {
|
|
4098
|
-
const raw = arr[0], text = raw;
|
|
4099
|
-
return [{
|
|
4100
|
-
type: "text",
|
|
4101
|
-
raw,
|
|
4102
|
-
text
|
|
4103
|
-
}];
|
|
4104
|
-
})
|
|
4105
|
-
}, {
|
|
4106
|
-
// spaces
|
|
4107
|
-
exec: (input, _) => match(input, /^\s+/, (arr) => {
|
|
4108
|
-
const raw = arr[0], text = raw;
|
|
4109
|
-
return [{
|
|
4110
|
-
type: "space",
|
|
4111
|
-
raw,
|
|
4112
|
-
text
|
|
4113
|
-
}];
|
|
4114
|
-
})
|
|
4115
|
-
}];
|
|
4116
|
-
var SCRIPT_RULES = [
|
|
4117
|
-
C_LIKE_RULES[0],
|
|
4118
|
-
C_LIKE_RULES[1],
|
|
4119
|
-
{
|
|
4120
|
-
// string literal
|
|
4121
|
-
exec: (input, _) => match(input, /^('(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"|`(\\`|[^`])*[^\\]?`)/, (arr) => {
|
|
4122
|
-
const raw = arr[0], text = raw;
|
|
4123
|
-
return [{
|
|
4124
|
-
type: "code-string",
|
|
4125
|
-
raw,
|
|
4126
|
-
text
|
|
4127
|
-
}];
|
|
4128
|
-
})
|
|
4129
|
-
},
|
|
4130
|
-
{
|
|
4131
|
-
// keywords
|
|
4132
|
-
exec: (input, _) => match(input, /^\b(abstract|any|arguments|async|await|boolean|break|byte|case|catch|char|class|const|continue|debugger|declare|default|delete|do|double|else|enum|eval|export|extends|false|final|finally|float|for|function|get|goto|if|implements|import|in|instanceof|int|interface|let|long|native|new|null|number|package|private|protected|public|return|short|static|string|super|switch|synchronized|this|throw|throws|transient|true|try|type|typeof|var|void|volatile|while|with|yield)\b/, (arr) => {
|
|
4133
|
-
const raw = arr[0], text = raw;
|
|
4134
|
-
return [{
|
|
4135
|
-
type: "code-keyword",
|
|
4136
|
-
raw,
|
|
4137
|
-
text
|
|
4138
|
-
}];
|
|
4139
|
-
})
|
|
4140
|
-
},
|
|
4141
|
-
C_LIKE_RULES[4],
|
|
4142
|
-
C_LIKE_RULES[5],
|
|
4143
|
-
C_LIKE_RULES[6]
|
|
4144
|
-
];
|
|
4145
3946
|
var TWITTER_RULE = {
|
|
4146
3947
|
rule: {
|
|
4147
3948
|
exec: (input) => {
|
|
@@ -4188,55 +3989,26 @@ var RULES_TO_HTML = (token) => {
|
|
|
4188
3989
|
case "tweet":
|
|
4189
3990
|
return `<!-- twitter embed -->
|
|
4190
3991
|
<${P18}-tweetembed tweetid="${token.text}"></${P18}-tweetembed>`;
|
|
4191
|
-
// code
|
|
4192
|
-
case "code-string":
|
|
4193
|
-
case "code-keyword":
|
|
4194
|
-
case "code-number":
|
|
4195
|
-
case "code-comment":
|
|
4196
|
-
case "code-tag":
|
|
4197
|
-
case "code-tagname":
|
|
4198
|
-
case "code-attribute":
|
|
4199
|
-
return `<span class="${token.type}">${token.text}</span>`;
|
|
4200
3992
|
}
|
|
4201
3993
|
};
|
|
4202
3994
|
var MarkdownService = class {
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
];
|
|
4208
|
-
for (let lang of ["c-sharp", "c", "c#", "csharp", "c++", "cpp"]) {
|
|
4209
|
-
const c_like_rules = C_LIKE_RULES.map((rule) => {
|
|
4210
|
-
return { rule, lang, type: "code" };
|
|
4211
|
-
});
|
|
4212
|
-
Array.prototype.push.apply(grammar, c_like_rules);
|
|
4213
|
-
}
|
|
4214
|
-
for (let lang of ["ts", "js", "typescript", "javascript"]) {
|
|
4215
|
-
const script_rules = SCRIPT_RULES.map((rule) => {
|
|
4216
|
-
return { rule, lang, type: "code" };
|
|
4217
|
-
});
|
|
4218
|
-
Array.prototype.push.apply(grammar, script_rules);
|
|
4219
|
-
}
|
|
4220
|
-
for (let lang of ["xml", "html"]) {
|
|
4221
|
-
const markup_rules = MARKUP_RULES.map((rule) => {
|
|
4222
|
-
return { rule, lang, type: "code" };
|
|
4223
|
-
});
|
|
4224
|
-
Array.prototype.push.apply(grammar, markup_rules);
|
|
4225
|
-
}
|
|
4226
|
-
this.#grammar = grammar;
|
|
4227
|
-
}
|
|
4228
|
-
#grammar;
|
|
3995
|
+
#grammar = [
|
|
3996
|
+
TWITTER_RULE,
|
|
3997
|
+
YOUTUBE_RULE
|
|
3998
|
+
];
|
|
4229
3999
|
#md = new Compile.Markdown.Parser();
|
|
4230
4000
|
_escape(md) {
|
|
4231
4001
|
return (md ?? "").replace(/</g, "<");
|
|
4232
4002
|
}
|
|
4233
4003
|
/** Converts the given Markdown source into an HTML string. */
|
|
4234
4004
|
toHtml(md) {
|
|
4235
|
-
|
|
4005
|
+
const escaped = this._escape(md);
|
|
4006
|
+
return this.#md.toHtml(escaped, this.#grammar, RULES_TO_HTML);
|
|
4236
4007
|
}
|
|
4237
4008
|
/** Tokenizes the given Markdown source, without rendering it to HTML. */
|
|
4238
4009
|
tokenize(md) {
|
|
4239
|
-
|
|
4010
|
+
const escaped = this._escape(md);
|
|
4011
|
+
return this.#md.tokenize(escaped, this.#grammar);
|
|
4240
4012
|
}
|
|
4241
4013
|
};
|
|
4242
4014
|
|