Skip to content

Commit

Permalink
release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
1cg committed Oct 20, 2024
1 parent 7669309 commit c81b07c
Show file tree
Hide file tree
Showing 134 changed files with 129,258 additions and 130 deletions.
240 changes: 120 additions & 120 deletions dist/_hyperscript.d.ts

Large diffs are not rendered by default.

55 changes: 47 additions & 8 deletions dist/_hyperscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@
tokens.push(consumeShortAttributeReference());
} else if (currentChar() === "*" && Lexer.isAlpha(nextChar())) {
tokens.push(consumeStyleReference());
} else if (Lexer.isAlpha(currentChar()) || (!inTemplate() && Lexer.isIdentifierChar(currentChar()))) {
} else if (inTemplate() && (Lexer.isAlpha(currentChar()) || currentChar() === "\\")) {
tokens.push(consumeTemplateIdentifier());
} else if (!inTemplate() && (Lexer.isAlpha(currentChar()) || Lexer.isIdentifierChar(currentChar()))) {
tokens.push(consumeIdentifier());
} else if (Lexer.isNumeric(currentChar())) {
tokens.push(consumeNumber());
Expand Down Expand Up @@ -441,6 +443,40 @@
return idRef;
}

/**
* @returns Token
*/
function consumeTemplateIdentifier() {
var identifier = makeToken("IDENTIFIER");
var value = consumeChar();
var escd = value === "\\";
if (escd) {
value = "";
}
while (Lexer.isAlpha(currentChar()) ||
Lexer.isNumeric(currentChar()) ||
Lexer.isIdentifierChar(currentChar()) ||
currentChar() === "\\" ||
currentChar() === "{" ||
currentChar() === "}" ) {
if (currentChar() === "$" && escd === false) {
break;
} else if (currentChar() === "\\") {
escd = true;
consumeChar();
} else {
escd = false;
value += consumeChar();
}
}
if (currentChar() === "!" && value === "beep") {
value += consumeChar();
}
identifier.value = value;
identifier.end = position;
return identifier;
}

/**
* @returns Token
*/
Expand Down Expand Up @@ -524,6 +560,7 @@
function consumeString() {
var string = makeToken("STRING");
var startChar = consumeChar(); // consume leading quote
string.template = startChar === "`";
var value = "";
while (currentChar() && currentChar() !== startChar) {
if (currentChar() === "\\") {
Expand All @@ -541,6 +578,8 @@
value += "\t";
} else if (nextChar === "v") {
value += "\v";
} else if (string.template && nextChar === "$") {
value += "\\$";
} else if (nextChar === "x") {
const hex = consumeHexEscape();
if (Number.isNaN(hex)) {
Expand All @@ -561,7 +600,6 @@
}
string.value = value;
string.end = position;
string.template = startChar === "`";
return string;
}

Expand Down Expand Up @@ -1453,6 +1491,7 @@
evt = new Event(eventName, {
bubbles: true,
cancelable: true,
composed: true,
});
evt['detail'] = detail;
} else {
Expand All @@ -1479,14 +1518,14 @@

/**
* isArrayLike returns `true` if the provided value is an array or
* a NodeList (which is close enough to being an array for our purposes).
* something close enough to being an array for our purposes.
*
* @param {any} value
* @returns {value is Array | NodeList}
* @returns {value is Array | NodeList | HTMLCollection | FileList}
*/
isArrayLike(value) {
return Array.isArray(value) ||
(typeof NodeList !== 'undefined' && (value instanceof NodeList || value instanceof HTMLCollection));
(typeof NodeList !== 'undefined' && (value instanceof NodeList || value instanceof HTMLCollection || value instanceof FileList));
}

/**
Expand Down Expand Up @@ -6522,7 +6561,7 @@
});
});
} else {
runtime.forEach(on, function (target) {
runtime.implicitLoop(on, function (target) {
if (target.hasAttribute(attributeRef.name)) {
target.removeAttribute(attributeRef.name);
} else {
Expand Down Expand Up @@ -7030,12 +7069,12 @@
if (tokens.matchToken("over")) {
var over = parser.requireElement("expression", tokens);
} else if (tokens.matchToken("using")) {
var using = parser.requireElement("expression", tokens);
var usingExpr = parser.requireElement("expression", tokens);
}

var transition = {
to: to,
args: [targetsExpr, properties, from, to, using, over],
args: [targetsExpr, properties, from, to, usingExpr, over],
op: function (context, targets, properties, from, to, using, over) {
runtime.nullCheck(targets, targetsExpr);
var promises = [];
Expand Down
2 changes: 1 addition & 1 deletion dist/_hyperscript.min.js

Large diffs are not rendered by default.

Binary file modified dist/_hyperscript.min.js.gz
Binary file not shown.
43 changes: 43 additions & 0 deletions dist/ext/tailwind.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
_hyperscript.config.hideShowStrategies = {
twDisplay: function (op, element, arg) {
if (op === "toggle") {
if (element.classList.contains("hidden")) {
_hyperscript.config.hideShowStrategies.twDisplay("show", element, arg);
} else {
_hyperscript.config.hideShowStrategies.twDisplay("hide", element, arg);
}
} else if (op === "hide") {
element.classList.add('hidden');
} else {
element.classList.remove('hidden');
}
},

twVisibility: function (op, element, arg) {
if (op === "toggle") {
if (element.classList.contains("invisible")) {
_hyperscript.config.hideShowStrategies.twVisibility("show", element, arg);
} else {
_hyperscript.config.hideShowStrategies.twVisibility("hide", element, arg);
}
} else if (op === "hide") {
element.classList.add('invisible');
} else {
element.classList.remove('invisible');
}
},

twOpacity: function (op, element, arg) {
if (op === "toggle") {
if (element.classList.contains("opacity-0")) {
_hyperscript.config.hideShowStrategies.twOpacity("show", element, arg);
} else {
_hyperscript.config.hideShowStrategies.twOpacity("hide", element, arg);
}
} else if (op === "hide") {
element.classList.add('opacity-0');
} else {
element.classList.remove('opacity-0');
}
}
};
2 changes: 1 addition & 1 deletion www/js/_hyperscript.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions www/posts/2024-10-20-hyperscript-0.9.13-is-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ We are pleased to present the [0.9.13 release](https://unpkg.com/browse/hyperscr

### Changes

* Triggered events now are maked as `bubbles:true` for better shadow DOM usage
* Support for Tailwinds CSS strategies for hide/show commands
* Fixed bug in toggling attributes on `<select>` elements
* Fixed but when auto-iterating FileList elements
* Fixed escaping in String Templates
* Many docs fixes

Enjoy!
Loading

0 comments on commit c81b07c

Please sign in to comment.