@react-pug/typescript-plugin-react-pug 0.1.0 → 0.1.2
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/plugin.js +19 -7
- package/dist/plugin.js.map +3 -3
- package/package.json +5 -2
package/dist/plugin.js
CHANGED
|
@@ -24945,10 +24945,9 @@ function emitAttribute(attr, emitter, pugText) {
|
|
|
24945
24945
|
if (typeof attr.val === "string") {
|
|
24946
24946
|
const val = attr.val;
|
|
24947
24947
|
if (val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'")) {
|
|
24948
|
-
emitter.emitSynthetic("=
|
|
24948
|
+
emitter.emitSynthetic("=");
|
|
24949
24949
|
const valOffset = attrOffset + attr.name.length + 1;
|
|
24950
24950
|
emitter.emitMapped(val, valOffset, FULL_FEATURES);
|
|
24951
|
-
emitter.emitSynthetic("}");
|
|
24952
24951
|
} else {
|
|
24953
24952
|
emitter.emitSynthetic("={");
|
|
24954
24953
|
const valOffset = attrOffset + attr.name.length + 1;
|
|
@@ -25040,7 +25039,7 @@ function emitBlockWithCodeSupport(nodes, emitter, pugText) {
|
|
|
25040
25039
|
if (jsxNodes.length === 0) {
|
|
25041
25040
|
emitter.emitSynthetic("null");
|
|
25042
25041
|
} else if (jsxNodes.length === 1) {
|
|
25043
|
-
|
|
25042
|
+
emitNodeAsExpression(jsxNodes[0], emitter, pugText);
|
|
25044
25043
|
} else {
|
|
25045
25044
|
emitter.emitSynthetic("<>");
|
|
25046
25045
|
for (const node of jsxNodes) {
|
|
@@ -25721,17 +25720,17 @@ ${target.closingIndent}}`,
|
|
|
25721
25720
|
}
|
|
25722
25721
|
function applyImportCleanups(doc, cleanups) {
|
|
25723
25722
|
if (cleanups.length === 0) return doc.shadowText;
|
|
25724
|
-
const
|
|
25723
|
+
const chars2 = doc.shadowText.split("");
|
|
25725
25724
|
for (const cleanup of cleanups) {
|
|
25726
25725
|
const shadowStart = originalToShadow(doc, cleanup.originalStart);
|
|
25727
25726
|
if (shadowStart == null) continue;
|
|
25728
25727
|
const shadowEnd = shadowStart + (cleanup.originalEnd - cleanup.originalStart);
|
|
25729
25728
|
for (let i = shadowStart; i < shadowEnd; i += 1) {
|
|
25730
|
-
|
|
25729
|
+
chars2[i] = "";
|
|
25731
25730
|
}
|
|
25732
|
-
|
|
25731
|
+
chars2[shadowStart] = cleanup.replacementText;
|
|
25733
25732
|
}
|
|
25734
|
-
return
|
|
25733
|
+
return chars2.join("");
|
|
25735
25734
|
}
|
|
25736
25735
|
function padToLength2(text, targetLength) {
|
|
25737
25736
|
if (text.length > targetLength) return null;
|
|
@@ -26010,6 +26009,19 @@ function buildShadowDocument(originalText, uri, version = 1, tagName = "pug", co
|
|
|
26010
26009
|
return document;
|
|
26011
26010
|
}
|
|
26012
26011
|
|
|
26012
|
+
// ../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
26013
|
+
var comma = ",".charCodeAt(0);
|
|
26014
|
+
var semicolon = ";".charCodeAt(0);
|
|
26015
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
26016
|
+
var intToChar = new Uint8Array(64);
|
|
26017
|
+
var charToInt = new Uint8Array(128);
|
|
26018
|
+
for (let i = 0; i < chars.length; i++) {
|
|
26019
|
+
const c = chars.charCodeAt(i);
|
|
26020
|
+
intToChar[i] = c;
|
|
26021
|
+
charToInt[c] = i;
|
|
26022
|
+
}
|
|
26023
|
+
var bufLength = 1024 * 16;
|
|
26024
|
+
|
|
26013
26025
|
// src/index.ts
|
|
26014
26026
|
var EXTRA_REACT_ATTRIBUTES_MARKER = "/* [pug-react] startupjs/cssxjs extra react attributes */";
|
|
26015
26027
|
var STARTUPJS_OR_CSSXJS_RE2 = /['"](?:startupjs|cssxjs)['"]/;
|