lapikit 0.3.5 → 0.3.6
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/entry-bundler.js
CHANGED
|
@@ -5,7 +5,7 @@ function componentName(shortName) {
|
|
|
5
5
|
// plugins lapikit
|
|
6
6
|
const lapikitPlugins = {
|
|
7
7
|
repl: {
|
|
8
|
-
components: ['
|
|
8
|
+
components: ['repl'],
|
|
9
9
|
ref: '@lapikit/repl'
|
|
10
10
|
}
|
|
11
11
|
};
|
|
@@ -31,7 +31,7 @@ function lapikitPreprocess(options) {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
const hasComponent = allComponents.some((comp) => content.includes(`<
|
|
34
|
+
const hasComponent = allComponents.some((comp) => content.includes(`<kit:${comp}`));
|
|
35
35
|
if (!hasComponent)
|
|
36
36
|
return;
|
|
37
37
|
let processedContent = content;
|
|
@@ -42,8 +42,8 @@ function lapikitPreprocess(options) {
|
|
|
42
42
|
for (const shortName of allComponents) {
|
|
43
43
|
const componentNameStr = componentName(shortName);
|
|
44
44
|
const attrPattern = `(?:[^>"']|"[^"]*"|'[^']*')*?`;
|
|
45
|
-
const selfClosingRegex = new RegExp(`<
|
|
46
|
-
const pairRegex = new RegExp(`<
|
|
45
|
+
const selfClosingRegex = new RegExp(`<kit:${shortName}(${attrPattern})\\s*/>`, 'g');
|
|
46
|
+
const pairRegex = new RegExp(`<kit:${shortName}(${attrPattern})>([\\s\\S]*?)<\\/kit:${shortName}\\s*>`, 'g');
|
|
47
47
|
let newContent = processedContent.replace(selfClosingRegex, (fullMatch, attrs) => {
|
|
48
48
|
hasChanges = true;
|
|
49
49
|
const ref = componentToRef.get(shortName) || 'lapikit/labs/components';
|