Skip to content

Commit

Permalink
Merge branch 'main' into fix/cast-content-as-string-paste-rule
Browse files Browse the repository at this point in the history
  • Loading branch information
gabemagee-ev authored May 31, 2024
2 parents 7c52478 + 1e562ec commit 9b0009e
Show file tree
Hide file tree
Showing 24 changed files with 347 additions and 258 deletions.
30 changes: 7 additions & 23 deletions demos/preview/Demo.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<template>
<demo-frame
v-if="inline"
:src="currentIframeUrl"
:key="currentIframeUrl"
/>
<div class="antialiased" v-else>
<div v-if="showTabs">
<div class="overflow-hidden antialiased rounded-lg">
<div class="px-3 py-1 bg-black flex items-center gap-0.5">
<button
v-for="(language, index) in sortedTabs"
:key="index"
@click="setTab(language.name)"
class="px-4 py-2 text-xs font-bold tracking-wide uppercase rounded-t-lg"
class="px-3 py-2 text-sm text-white leading-[125%] font-semibold rounded-[0.625rem] transition-all"
:class="[currentTab === language.name
? 'bg-black text-white'
: 'text-black'
? 'opacity-100 bg-[#1C1917]'
: 'opacity-50 bg-transparent hover:opacity-100 hover:bg-[#1C1917]'
]"
>
{{ language.name }}
</button>
</div>
<div class="overflow-hidden rounded-b-xl">
<div class="overflow-hidden">
<div
class="bg-white border-black border-3 last:rounded-b-xl"
:class="[
showTabs && firstTabSelected
? 'rounded-tr-xl'
: 'rounded-t-xl',
]"
class="bg-white"
>
<demo-frame
:src="currentIframeUrl"
Expand Down Expand Up @@ -122,10 +112,6 @@ export default {
},
computed: {
showTabs() {
return this.sortedTabs.length > 1
},
currentIframeUrl() {
return `/src/${this.name}/${this.currentTab}/`
},
Expand Down Expand Up @@ -170,8 +156,6 @@ export default {
setTab(name, persist = true) {
this.currentTab = name
this.sources = {}
this.currentFile = null
if (persist) {
localStorage.tab = name
Expand Down
4 changes: 2 additions & 2 deletions demos/src/Examples/Images/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default () => {
],
content: `
<p>This is a basic example of implementing images. Drag to re-order.</p>
<img src="https://source.unsplash.com/8xznAGy4HcY/800x400" />
<img src="https://source.unsplash.com/K9QHL52rE2k/800x400" />
<img src="https://placehold.co/600x400" />
<img src="https://placehold.co/800x400" />
`,
})

Expand Down
2 changes: 1 addition & 1 deletion demos/src/Examples/Images/React/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ context('/src/Examples/Images/React/', () => {

it('allows images to be added via URL', () => {
cy.window().then(win => {
cy.stub(win, 'prompt').returns('https://unsplash.it/250/250')
cy.stub(win, 'prompt').returns('https://placehold.co/400x400')

cy.wait(1000)
cy.get('button').contains('add image from URL').click({ force: false })
Expand Down
2 changes: 1 addition & 1 deletion demos/src/Examples/Images/Vue/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ context('/src/Examples/Images/Vue/', () => {

it('allows images to be added via URL', () => {
cy.window().then(win => {
cy.stub(win, 'prompt').returns('https://unsplash.it/250/250')
cy.stub(win, 'prompt').returns('https://placehold.co/400x400')

cy.wait(1000)
cy.get('button').contains('add image from URL').click({ force: false })
Expand Down
4 changes: 2 additions & 2 deletions demos/src/Examples/Images/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export default {
],
content: `
<p>This is a basic example of implementing images. Drag to re-order.</p>
<img src="https://source.unsplash.com/8xznAGy4HcY/800x400" />
<img src="https://source.unsplash.com/K9QHL52rE2k/800x400" />
<img src="https://placehold.co/600x400" />
<img src="https://placehold.co/800x400" />
`,
})
},
Expand Down
1 change: 1 addition & 0 deletions demos/src/Nodes/Youtube/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default () => {
StarterKit,
Youtube.configure({
controls: false,
nocookie: true,
}),
],
content: `
Expand Down
8 changes: 4 additions & 4 deletions demos/src/Nodes/Youtube/React/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ context('/src/Nodes/Youtube/React/', () => {
cy.get('#add').eq(0).click()
cy.get('.tiptap div[data-youtube-video] iframe')
.should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/hBp4dgE7Bho?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/hBp4dgE7Bho?controls=0')
})
})

Expand All @@ -24,7 +24,7 @@ context('/src/Nodes/Youtube/React/', () => {
cy.get('#height').type('{selectall}{backspace}240')
cy.get('#add').eq(0).click()
cy.get('.tiptap div[data-youtube-video] iframe').should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/hBp4dgE7Bho?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/hBp4dgE7Bho?controls=0')
.should('have.css', 'width', '320px')
.should('have.css', 'height', '240px')
})
Expand All @@ -45,7 +45,7 @@ context('/src/Nodes/Youtube/React/', () => {
cy.get('#add').eq(0).click()
cy.get('.tiptap div[data-youtube-video] iframe')
.should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/hBp4dgE7Bho?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/hBp4dgE7Bho?controls=0')

cy.get('.tiptap div[data-youtube-video] iframe')
.click()
Expand All @@ -54,7 +54,7 @@ context('/src/Nodes/Youtube/React/', () => {

cy.get('.tiptap div[data-youtube-video] iframe')
.should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/wRakoMYVHm8?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/wRakoMYVHm8?controls=0')
})
})
})
8 changes: 4 additions & 4 deletions demos/src/Nodes/Youtube/Vue/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ context('/src/Nodes/Youtube/Vue/', () => {
cy.get('#add').eq(0).click()
cy.get('.tiptap div[data-youtube-video] iframe')
.should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/hBp4dgE7Bho?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/hBp4dgE7Bho?controls=0')
})
})

Expand All @@ -24,7 +24,7 @@ context('/src/Nodes/Youtube/Vue/', () => {
cy.get('#height').type('{selectall}{backspace}240')
cy.get('#add').eq(0).click()
cy.get('.tiptap div[data-youtube-video] iframe').should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/hBp4dgE7Bho?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/hBp4dgE7Bho?controls=0')
.should('have.css', 'width', '320px')
.should('have.css', 'height', '240px')
})
Expand All @@ -45,7 +45,7 @@ context('/src/Nodes/Youtube/Vue/', () => {
cy.get('#add').eq(0).click()
cy.get('.tiptap div[data-youtube-video] iframe')
.should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/hBp4dgE7Bho?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/hBp4dgE7Bho?controls=0')

cy.get('.tiptap div[data-youtube-video] iframe')
.click()
Expand All @@ -54,7 +54,7 @@ context('/src/Nodes/Youtube/Vue/', () => {

cy.get('.tiptap div[data-youtube-video] iframe')
.should('have.length', 1)
.should('have.attr', 'src', 'https://www.youtube.com/embed/wRakoMYVHm8?controls=0')
.should('have.attr', 'src', 'https://www.youtube-nocookie.com/embed/wRakoMYVHm8?controls=0')
})
})
})
1 change: 1 addition & 0 deletions demos/src/Nodes/Youtube/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default {
StarterKit,
Youtube.configure({
controls: false,
nocookie: true,
}),
],
content: `
Expand Down
8 changes: 0 additions & 8 deletions docs/api/marks/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ Link.configure({
})
```

If set to `'whenNotEditable'`, links will be opened on click only when editor is not editable.

```js
Link.configure({
openOnClick: 'whenNotEditable',
})
```

### linkOnPaste
Adds a link to the current selection if the pasted content only contains an url.

Expand Down
3 changes: 3 additions & 0 deletions docs/collaboration/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Several `key` settings can be adjusted dynamically:
- **webhook_url**: Optional webhook URL for receiving callbacks.
- **authentication_disabled**: Toggle for enabling/disabling authentication (1 for disabled, 0 for enabled, with the default being 0).
- **name**: Optional instance name.
- **webhook_version**: The webhook version
- **default_auto_versioning**: Turn auto versioning on or off by default (1 for enabled, 0 for off).
- **default_auto_versioning_interval**: Default versioning interval (default is 30 seconds)

## Managing Settings via API

Expand Down
2 changes: 1 addition & 1 deletion docs/installation/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ npm install @tiptap/react @tiptap/pm @tiptap/starter-kit
If you followed step 1 and 2, you can now start your project with `npm run dev`, and open [http://localhost:3000/](http://localhost:3000/) in your favorite browser. This might be different, if you’re working with an existing project.

## 3. Create a new component
To actually start using Tiptap, you’ll need to add a new component to your app. To do this, first create a directory called `components/`. Now it's time to create our component which we'll call `Tiptap`. To do this put the following example code in `components/Tiptap.js`.
To actually start using Tiptap, you’ll need to add a new component to your app. To do this, first create a directory called `components/`. Now it's time to create our component which we'll call `Tiptap`. To do this put the following example code in `components/Tiptap.jsx`.

```jsx
'use client'
Expand Down
2 changes: 2 additions & 0 deletions docs/installation/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ We provide [an official PHP package to work with Tiptap content](/api/utilities/
wire:poll.10000ms="autosave"
></x-editor>
```
**Note**<br />
The `.defer` modifier is no longer available in Livewire v3 as updating the state is deferred by default. Use the `.live` modifier if you need to update the state server-side as it changes.

### editor.blade.php
```html
Expand Down
Loading

0 comments on commit 9b0009e

Please sign in to comment.