This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
funtion WidthField({ label, describing }) { | |
// Not sure about `describing`, but wanted some way to associate what the whole field is related to | |
return ( | |
<Fieldset> | |
<Legend><VisuallyHidden>{describing}</VisuallyHidden> {label}</Legend> | |
<RadioButtonGroup> | |
<VisuallyHidden><Label> type (?)</Label></VisuallyHidden> | |
</RadioButtonGroup> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html = <<~HTML | |
{% assign message = "hello" %} | |
<div> | |
{% product 123 %} | |
<div>{{ product.title }}</div> | |
{% endproduct %} | |
{% product 456 %} | |
Liquid works inside these blocks | |
<div>{{ message }}</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// option 1 | |
{% product 123 %} | |
<div> | |
<h2>{% product.title %}</h2> | |
</div> | |
{% endproduct %} | |
// option 2 | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from "react" | |
import { confirm } from "../modals" | |
const hrefBlank = element => { | |
const href = element.getAttribute("href") | |
return !href || href === "#" | |
} | |
function useBeforeLeave({ | |
message = "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: cypress/base:8 | |
working_directory: ~/repo | |
resource_class: large | |
steps: | |
- checkout | |
- restore_cache: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { html } from "../../packages/editor/src/utils/htm"; | |
context("Captions", () => { | |
beforeEach(() => { | |
cy.visit("http://localhost:3000/"); | |
}); | |
it("should show if the image is focused", () => { | |
cy.setEditorValue(html` | |
<value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { html } from "../../packages/editor/src/utils/htm"; | |
context("Captions", () => { | |
beforeEach(() => { | |
cy.visit("http://localhost:3000/"); | |
}); | |
it("should show if the image is focused", () => { | |
cy.setEditorValue(html` | |
<value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { html } from "../../packages/editor/src/utils/htm"; | |
context("Focusing on placeholder", () => { | |
beforeEach(() => { | |
cy.visit("http://localhost:3000/"); | |
}); | |
// We had a bug where trying to change the first line in an empty editor to | |
// a heading would crash the editor. This is because Slate was trying to | |
// resolve the selection before the editor has focus. See `change-block` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Block, Text } from "slate"; | |
export function createCaptioned({ type, caption, data }) { | |
const block = | |
typeof caption === "string" | |
? Block.create({ type: "caption", nodes: [Text.create(caption)] }) | |
: caption; | |
const captioned = Block.create({ |