Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some ideas for making placeholders read only #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukesmurray
Copy link
Owner

No description provided.

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

size-limit report 📦

Path Size
dist/slate-snippets.cjs.production.min.js 75.62 KB (+210.38% 🔺)
dist/slate-snippets.esm.js 64.89 KB (+177.45% 🔺)

Copy link
Owner Author

@lukesmurray lukesmurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Styling needs to be parameterized
  • Read only behavior needs to be parameterized
  • open questions
    • can you delete a read only void element in a snippet? If I backspace in a placeholder maybe lock backspace to the placeholder, same with navigated (left, right arrow etc),
    • If you click on a part of a snippet that isn't a placeholder should you select the entire snippet? should you select the nearest placeholder?
  • can we normalize void elements so they are merged together if they are adjacent to each other with no placeholder in between
  • can we link the void element text to the "snippet definition" following the component metaphor?

<span
style={{
padding: '0px 1px',
border: `2px solid ${leaf.isFinalTabStop ? 'grey' : placeholderColor}`,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final tab stop styling should be parameterized, also styling for empty/non empty placeholders should be parameterized

Comment on lines +18 to +26
style={{
padding: '3px 3px 2px',
margin: '0 1px',
verticalAlign: 'baseline',
display: 'inline-block',
borderRadius: '4px',
backgroundColor: '#eee',
fontSize: '0.9em',
boxShadow: selected && focused ? '0 0 0 2px #B4D5FF' : 'none',
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styling for read only snippet should be parameterized

Comment on lines +256 to +260
result.push({
children: [{ text: v }],
type: 'SnippetReadonlyText',
label: v,
});
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should parameterize whether or not snippet text is read only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant