Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #239 from WordPress/rename-sufix-character-and-isl…
Browse files Browse the repository at this point in the history
…and-directive

Rename sufix character and island directive
  • Loading branch information
luisherranz authored Jun 1, 2023
2 parents e82f377 + c71f533 commit 06f4876
Show file tree
Hide file tree
Showing 27 changed files with 124 additions and 107 deletions.
4 changes: 2 additions & 2 deletions e2e/html/csn-page-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h1 data-testid="csn-heading-page-2">Client-side navigation Page 2</h1>
<h2 data-testid="csn-subheading">Subheading</h2>
<button
data-wp-on.click="actions.toggleNewValue"
data-wp-on--click="actions.toggleNewValue"
data-testid="toggle newValue"
>
Toggle trueValue
Expand All @@ -29,7 +29,7 @@ <h2 data-testid="csn-subheading">Subheading</h2>
</div>

<button
data-wp-on.click="actions.replaceWithPage3"
data-wp-on--click="actions.replaceWithPage3"
data-testid="replace with page 3"
>
Replace with page 3
Expand Down
22 changes: 11 additions & 11 deletions e2e/html/directive-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,50 @@
</head>
<body>
<a
data-wp-bind.href="state.url"
data-wp-bind--href="state.url"
data-testid="add missing href at hydration"
></a>

<a
href="/other-url"
data-wp-bind.href="state.url"
data-wp-bind--href="state.url"
data-testid="change href at hydration"
></a>

<input
type="checkbox"
data-wp-bind.checked="state.checked"
data-wp-bind--checked="state.checked"
data-testid="add missing checked at hydration"
/>

<input
type="checkbox"
checked
data-wp-bind.checked="!state.checked"
data-wp-bind--checked="!state.checked"
data-testid="remove existing checked at hydration"
/>

<a
href="/other-url"
data-wp-bind.href="state.url"
data-wp-bind--href="state.url"
data-testid="nested binds - 1"
>
<img
width="1"
data-wp-bind.width="state.width"
data-wp-bind--width="state.width"
data-testid="nested binds - 2"
/>
</a>

<button data-testid="toggle" data-wp-on.click="actions.toggle">
<button data-testid="toggle" data-wp-on--click="actions.toggle">
Update
</button>

<p
data-wp-bind.hidden="!state.show"
data-wp-bind.aria-hidden="!state.show"
data-wp-bind.aria-expanded="state.show"
data-wp-bind.data-some-value="state.show"
data-wp-bind--hidden="!state.show"
data-wp-bind--aria-hidden="!state.show"
data-wp-bind--aria-expanded="state.show"
data-wp-bind--data-some-value="state.show"
data-testid="check enumerated attributes with true/false exist and have a string value"
>
Some Text
Expand Down
26 changes: 13 additions & 13 deletions e2e/html/directives-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,65 @@
</head>
<body>
<button
data-wp-on.click="actions.toggleTrueValue"
data-wp-on--click="actions.toggleTrueValue"
data-testid="toggle trueValue"
>
Toggle trueValue
</button>

<button
data-wp-on.click="actions.toggleFalseValue"
data-wp-on--click="actions.toggleFalseValue"
data-testid="toggle falseValue"
>
Toggle falseValue
</button>

<div
class="foo bar"
data-wp-class.foo="state.falseValue"
data-wp-class--foo="state.falseValue"
data-testid="remove class if callback returns falsy value"
></div>

<div
class="foo"
data-wp-class.bar="state.trueValue"
data-wp-class--bar="state.trueValue"
data-testid="add class if callback returns truthy value"
></div>

<div
class="foo bar"
data-wp-class.foo="state.falseValue"
data-wp-class.bar="state.trueValue"
data-wp-class.baz="state.trueValue"
data-wp-class--foo="state.falseValue"
data-wp-class--bar="state.trueValue"
data-wp-class--baz="state.trueValue"
data-testid="handles multiple classes and callbacks"
></div>

<div
class="foo foo-bar"
data-wp-class.foo="state.falseValue"
data-wp-class.foo-bar="state.trueValue"
data-wp-class--foo="state.falseValue"
data-wp-class--foo-bar="state.trueValue"
data-testid="handles class names that are contained inside other class names"
></div>

<div
class="foo bar baz"
data-wp-class.bar="state.trueValue"
data-wp-class--bar="state.trueValue"
data-testid="can toggle class in the middle"
></div>

<div
data-wp-class.foo="state.falseValue"
data-wp-class--foo="state.falseValue"
data-testid="can toggle class when class attribute is missing"
></div>

<div data-wp-context='{ "falseValue": false }'>
<div
class="foo"
data-wp-class.foo="context.falseValue"
data-wp-class--foo="context.falseValue"
data-testid="can use context values"
></div>
<button
data-wp-on.click="actions.toggleContextFalseValue"
data-wp-on--click="actions.toggleContextFalseValue"
data-testid="toggle context false value"
>
Toggle context falseValue
Expand Down
28 changes: 14 additions & 14 deletions e2e/html/directives-context.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,39 @@
>
<pre
data-testid="parent context"
data-wp-bind.children="derived.renderContext"
data-wp-bind--children="derived.renderContext"
>
<!-- rendered during hydration -->
</pre>
<button
data-testid="parent prop1"
name="prop1"
value="modifiedFromParent"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
prop1
</button>
<button
data-testid="parent prop2"
name="prop2"
value="modifiedFromParent"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
prop2
</button>
<button
data-testid="parent obj.prop4"
name="obj.prop4"
value="modifiedFromParent"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
obj.prop4
</button>
<button
data-testid="parent obj.prop5"
name="obj.prop5"
value="modifiedFromParent"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
obj.prop5
</button>
Expand All @@ -52,55 +52,55 @@
>
<pre
data-testid="child context"
data-wp-bind.children="derived.renderContext"
data-wp-bind--children="derived.renderContext"
>
<!-- rendered during hydration -->
</pre>
<button
data-testid="child prop1"
name="prop1"
value="modifiedFromChild"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
prop1
</button>
<button
data-testid="child prop2"
name="prop2"
value="modifiedFromChild"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
prop2
</button>
<button
data-testid="child prop3"
name="prop3"
value="modifiedFromChild"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
prop3
</button>
<button
data-testid="child obj.prop4"
name="obj.prop4"
value="modifiedFromChild"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
obj.prop4
</button>
<button
data-testid="child obj.prop5"
name="obj.prop5"
value="modifiedFromChild"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
obj.prop5
</button>
<button
data-testid="child obj.prop6"
name="obj.prop6"
value="modifiedFromChild"
data-wp-on.click="actions.updateContext"
data-wp-on--click="actions.updateContext"
>
obj.prop6
</button>
Expand All @@ -111,8 +111,8 @@
data-testid="context & other directives"
data-wp-context='{ "text": "Text 1" }'
data-wp-text="context.text"
data-wp-on.click="actions.toggleContextText"
data-wp-bind.value="context.text"
data-wp-on--click="actions.toggleContextText"
data-wp-bind--value="context.text"
>
Toggle Context Text
</button>
Expand Down
2 changes: 1 addition & 1 deletion e2e/html/directives-effect.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<div data-wp-effect="effects.changeFocus"></div>

<button data-testid="toggle" data-wp-on.click="actions.toggle">
<button data-testid="toggle" data-wp-on--click="actions.toggle">
Update
</button>

Expand Down
6 changes: 3 additions & 3 deletions e2e/html/directives-show.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
</head>
<body>
<button
data-wp-on.click="actions.toggleTrueValue"
data-wp-on--click="actions.toggleTrueValue"
data-testid="toggle trueValue"
>
Toggle trueValue
</button>

<button
data-wp-on.click="actions.toggleFalseValue"
data-wp-on--click="actions.toggleFalseValue"
data-testid="toggle falseValue"
>
Toggle falseValue
Expand Down Expand Up @@ -42,7 +42,7 @@
falseValue
</div>
<button
data-wp-on.click="actions.toggleContextFalseValue"
data-wp-on--click="actions.toggleContextFalseValue"
data-testid="toggle context false value"
>
Toggle context falseValue
Expand Down
4 changes: 2 additions & 2 deletions e2e/html/directives-text.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
data-testid="show state text"
></span>
<button
data-wp-on.click="actions.toggleStateText"
data-wp-on--click="actions.toggleStateText"
data-testid="toggle state text"
>
Toggle State Text
Expand All @@ -24,7 +24,7 @@
data-testid="show context text"
></span>
<button
data-wp-on.click="actions.toggleContextText"
data-wp-on--click="actions.toggleContextText"
data-testid="toggle context text"
>
Toggle Context Text
Expand Down
6 changes: 3 additions & 3 deletions e2e/html/negation-operator.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
</head>
<body>
<button
data-wp-on.click="actions.toggle"
data-wp-on--click="actions.toggle"
data-testid="toggle active value"
>
Toggle Active Value
</button>

<div
data-wp-bind.hidden="!state.active"
data-wp-bind--hidden="!state.active"
data-testid="add hidden attribute if state is not active"
></div>

<div
data-wp-bind.hidden="!selectors.active"
data-wp-bind--hidden="!selectors.active"
data-testid="add hidden attribute if selector is not active"
></div>

Expand Down
8 changes: 4 additions & 4 deletions e2e/html/store-tag-corrupted-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
<div>
Counter:
<span
data-wp-bind.children="state.counter.value"
data-wp-bind--children="state.counter.value"
data-testid="counter value"
>3</span
>
<br />
Double:
<span
data-wp-bind.children="state.counter.double"
data-wp-bind--children="state.counter.double"
data-testid="counter double"
>6</span
>
<br />
<button
data-wp-on.click="actions.counter.increment"
data-wp-on--click="actions.counter.increment"
data-testid="counter button"
>
+1
</button>
<span
data-wp-bind.children="state.counter.clicks"
data-wp-bind--children="state.counter.clicks"
data-testid="counter clicks"
>0</span
>
Expand Down
Loading

0 comments on commit 06f4876

Please sign in to comment.