Giter Site home page Giter Site logo

editor-protocol's People

Contributors

zbeyens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

backbayrider

editor-protocol's Issues

Move selection before table on ↑ from first row cell

CleanShot.2022-05-28.at.20.43.05.mp4

Given

  • table 2x2
  • cursor at a cell in first row
        <editor>
          <hp>test</hp>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>
                12
                <cursor />
              </htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • press ↑

Then

  • cursor just before table
        <editor>
          <hp>
            test
            <cursor />
          </hp>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Move block without page to previous page

Given

  • node a at level 0
  • a is not a page
  • previous node: page node b
const input = (
          <editor>
            <hpage>
              <hp>b</hp>
            </hpage>
            <hp>a</hp>
          </editor>
        )

When

  • normalize a

Then

  • move a to end of b
const output = (
          <editor>
            <hpage>
              <hp>b</hp>
              <hp>a</hp>
            </hpage>
          </editor>
        )

Move block without page to next page

Given

  • node a at level 0
  • a is not a page
  • next node: page node b
const input = (
          <editor>
            <hp>a</hp>
            <hpage>
              <hp>b</hp>
            </hpage>
          </editor>
        )

When

  • normalize a

Then

  • move a to start of b
const output = (
          <editor>
            <hpage>
              <hp>a</hp>
              <hp>b</hp>
            </hpage>
          </editor>
        )

Insert a table when selecting table cells should replace these cells

Given

  • table 2x2
  • select cells 11 to 22
        <editor>
          <htable>
            <htr>
              <htd>
                <anchor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>
                22
                <focus />
              </htd>
            </htr>
          </htable>
        </editor>

When

  • insert table
        <fragment>
          <htable>
            <htr>
              <htd>a</htd>
              <htd>b</htd>
            </htr>
          </htable>
        </fragment>

Then

  • replace the corresponding cells and keep the other ones
        <editor>
          <htable>
            <htr>
              <htd>a</htd>
              <htd>b</htd>
            </htr>
            <htr>
              <htd>
                <htext />
              </htd>
              <htd>
                <htext />
              </htd>
            </htr>
          </htable>
        </editor>

Paging

Description

Wraps root blocks into page blocks.

Specs

Delete when selecting cells should select the first selected cell

2022-05-28.at.20.50.59.mp4

Given

  • selecting many table cells
        <editor>
          <htable>
            <htr>
              <htd>
                <anchor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                21
                <focus />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • delete fragment

Then

  • cursor is at the first deleted cell
        <editor>
          <htable>
            <htr>
              <htd>
                <htext /><cursor />
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                <htext />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Expand selection to left cell on ⇧+← when selecting columns <= anchor

2022-05-28.at.22.20.10.mp4

Given

  • table 2x2
  • selected cells: 12
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>
                12
                <cursor />
              </htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • press ⇧+←

Then

  • selected cells: 11-12
        <editor>
          <htable>
            <htr>
              <htd>
                <anchor />
                11
              </htd>
              <htd>
                <focus />
                12
              </htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Expand selection to cell below on ⇧+↓

2022-05-28.at.22.21.42.mp4

Given

  • table 2x2
  • cursor at cell 11
        <editor>
          <htable>
            <htr>
              <htd>
                <cursor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • press ⇧+↓

Then

  • selected cells: 11-21
        <editor>
          <htable>
            <htr>
              <htd>
                <anchor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                <focus />
                21
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Insert one row table at first table cell

2022-05-28.at.20.55.34.mp4

Given

  • table 2x2
        <editor>
          <htable>
            <htr>
              <htd>
                11
                <cursor />
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • insert table 1x2 into cell 11
        <fragment>
          <htable>
            <htr>
              <htd>a</htd>
              <htd>b</htd>
            </htr>
          </htable>
        </fragment>

Then

  • first table row should be replaced by the inserted table row
        <editor>
          <htable>
            <htr>
              <htd>a</htd>
              <htd>b</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Delete when selecting cells should remove the cells content

2022-05-28.at.20.57.20.mp4

Given

  • selecting many table cells
        <editor>
          <htable>
            <htr>
              <htd>
                <anchor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                21
                <focus />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • delete fragment

Then

  • delete cells content
        <editor>
          <htable>
            <htr>
              <htd>
                <htext />
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                <htext />
                <cursor />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When many blocks are out of page bounds, move those to the next page

Given

  • page 1 of height 100
  • 5 blocks of height 30 in p
  • the last 2 blocks are out of bounds
  • second page has block 6
<editor>
          <hpage>
            <hp>1</hp>
            <hp>2</hp>
            <hp>3</hp>
            <hp>4</hp>
            <hp>5</hp>
          </hpage>
          <hpage>
            <hp>6</hp>
          </hpage>
        </editor>

When

  • normalize page 1

Then

  • blocks 4 and 5 are moved to start of page 2
<editor>
          <hpage>
            <hp>1</hp>
            <hp>2</hp>
            <hp>3</hp>
          </hpage>
          <hpage>
            <hp>4</hp>
            <hp>5</hp>
            <hp>6</hp>
          </hpage>
        </editor>

When there is no pages, wrap into a page

Given

  • node b that is not a page
  • no page before/after
const input = (
          <editor>
            <hp>b</hp>
            <hp>a</hp>
          </editor>
        )

When

  • normalize b
  • normalize a

Then

  • wrap b into a page
  • a is moved to the new page
const output = (
          <editor>
            <hpage>
              <hp>b</hp>
              <hp>a</hp>
            </hpage>
          </editor>
        )

Insert cells should expand the table if there is no room

2022-06-06.at.20.58.28.mp4

Given

  • table 2x2
  • cursor at cell 22
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>
                22
                <cursor />
              </htd>
            </htr>
          </htable>
        </editor>

When

  • insert table 2x2
        <fragment>
          <htable>
            <htr>
              <htd>aa</htd>
              <htd>ab</htd>
            </htr>
            <htr>
              <htd>ba</htd>
              <htd>bb</htd>
            </htr>
          </htable>
        </fragment>

Then

  • expanded table with the inserted cells
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
              <htd>
                <htext />
              </htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>
                <anchor />
                aa
              </htd>
              <htd>ab</htd>
            </htr>
            <htr>
              <htd>
                <htext />
              </htd>
              <htd>ba</htd>
              <htd>
                <focus />
                bb
              </htd>
            </htr>
          </htable>
        </editor>

Insert url text in a link

2022-07-13.at.19.11.28.mp4

Given

  • cursor in a link
        <editor>
          <hp>
            .
            <ha url={url}>
              insert link
              <cursor />
            </ha>
            .
          </hp>
        </editor>

When

  • insert url text

Then

  • insert text
        <editor>
          <hp>
            .<ha url={url}>insert link{url}</ha>.
          </hp>
        </editor>

Move selection after table on ↓ from last row cell

2022-05-28.at.20.50.00.mp4

Given

  • table 2x2
  • cursor at cell 21
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                21
                <cursor />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
          <hp>test</hp>
        </editor>

When

  • press ↓

Then

  • cursor after table
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
          <hp>
            <cursor />
            test
          </hp>
        </editor>

Select table cells with mouse

CleanShot.2022-05-28.at.20.41.47.mp4

Given

  • many table cells

When

  • selection contains many table cells

Then

  • block select the cells

Insert table cells at a table should select the inserted cells

2022-05-28.at.20.52.36.mp4

Given

  • table 2x2
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>
                12
                <cursor />
              </htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • insert table 2x1 at cell 21
        <fragment>
          <htable>
            <htr>
              <htd>a</htd>
            </htr>
            <htr>
              <htd>b</htd>
            </htr>
          </htable>
        </fragment>

Then

  • cells 21 and 22 should be selected
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>
                <anchor />a
              </htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>
                <focus />b
              </htd>
            </htr>
          </htable>
        </editor>

Move selection to cell above on ↑ from a cell

2022-05-28.at.20.47.18.mp4

Given

  • table 2x2
  • cursor at cell 21
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                21
                <cursor />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • press ↑

Then

  • cursor at cell 11
        <editor>
          <htable>
            <htr>
              <htd>
                <cursor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Delete backward after a table should select its last cell

2022-05-28.at.20.58.04.mp4

Given

  • cursor at block start after table
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
          </htable>
          <hp>
            <cursor />a
          </hp>
        </editor>

When

  • delete backward

Then

  • cursor is in last table cell
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>
                12
                <cursor />
              </htd>
            </htr>
          </htable>
          <hp>a</hp>
        </editor>

Copy table cells should get a subtable with these cells

2022-05-28.at.20.53.20.mp4

Given

  • table 2x2
        <editor>
          <htable>
            <htr>
              <htd>
                11
                <anchor />
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                21
                <focus />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • copy cells 11-21

Then

  • should copy a subtable 2x1 with 11-21 cells
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
            </htr>
            <htr>
              <htd>21</htd>
            </htr>
          </htable>
        </editor>

Insert url text

2022-07-13.at.18.52.39.mp4

Given

  • cursor in a block
          <editor>
            <hp>
              test
              <cursor />
            </hp>
          </editor>

When

  • insert url text

Then

  • it should insert a link
          <editor>
            <hp>
              test
              <ha url="http://google.com">http://google.com</ha>
              <htext />
            </hp>
          </editor>

Expand selection to cell below on ⇧+↑

2022-05-28.at.22.22.10.mp4

Given

  • table 2x2
  • cursor at cell 21
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                21
                <cursor />
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • press ⇧+↑

Then

  • selected cells: 11-21
        <editor>
          <htable>
            <htr>
              <htd>
                <anchor />
                11
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                <focus />
                21
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Delete forward before a table should select its first cell

2022-05-28.at.20.58.36.mp4

Given

  • cursor at block end before table
        <editor>
          <hp>
            a<cursor />
          </hp>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
          </htable>
        </editor>

When

  • delete forward

Then

  • cursor is at first table cell
        <editor>
          <hp>a</hp>
          <htable>
            <htr>
              <htd>
                <cursor />
                11
              </htd>
              <htd>12</htd>
            </htr>
          </htable>
        </editor>

Insert one col table at first table cell

2022-05-28.at.20.54.38.mp4

Given

  • table 2x2
        <editor>
          <htable>
            <htr>
              <htd>
                11
                <cursor />
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • insert table 2x1 into cell 11
        <fragment>
          <htable>
            <htr>
              <htd>a</htd>
            </htr>
            <htr>
              <htd>b</htd>
            </htr>
          </htable>
        </fragment>

Then

  • first table column should be replaced by the inserted table column
        <editor>
          <htable>
            <htr>
              <htd>a</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>b</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Move selection to cell below on ↓ from a cell

2022-05-28.at.20.48.07.mp4

Given

  • table 2x2
  • cursor at cell 11
        <editor>
          <htable>
            <htr>
              <htd>
                11
                <cursor />
              </htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>21</htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

When

  • press ↓

Then

  • cursor at cell 21
        <editor>
          <htable>
            <htr>
              <htd>11</htd>
              <htd>12</htd>
            </htr>
            <htr>
              <htd>
                <cursor />
                21
              </htd>
              <htd>22</htd>
            </htr>
          </htable>
        </editor>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.