-
Notifications
You must be signed in to change notification settings - Fork 12
Cs 10042 make field configuration playground editable without server writes for unauthorized user #3848
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
Open
lucaslyl
wants to merge
16
commits into
main
Choose a base branch
from
CS-10042-make-field-configuration-playground-editable-without-server-writes-for-unauthorized-user
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,298
−1,562
Open
Cs 10042 make field configuration playground editable without server writes for unauthorized user #3848
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
55b2f77
Add canEdit prop override to BoxComponent for field editability control
lucaslyl f042d6d
implement code snippet on isolated and edit template
lucaslyl a6a4064
fix alignment run css
lucaslyl 018dddd
every field component must have disabled args
lucaslyl 6cc8ee0
fix lint
lucaslyl 58b05d1
Address styling feedback
lucaslyl 0356199
fix test
lucaslyl b327cf2
fix lint
lucaslyl 81e5c18
add --boxel-caption-line-height
lucaslyl 67242f1
Merge branch 'main' into CS-10042-make-field-configuration-playground…
lucaslyl 5fc8bd8
break base Spec to smaller component
lucaslyl 417895e
implement ExamplesWithInteractive to all field spec
lucaslyl 2590ece
Merge branch 'main' into CS-10042-make-field-configuration-playground…
lucaslyl b939c5b
fix lint & move ExamplesWithInteractiveSignature to base spec
lucaslyl bc36888
remove wrong code
lucaslyl e90142e
remove empty space
lucaslyl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| import GlimmerComponent from '@glimmer/component'; | ||
| import { CopyButton } from '@cardstack/boxel-ui/components'; | ||
|
|
||
| export interface CodeSnippetSignature { | ||
| Args: { | ||
| code: string; | ||
| }; | ||
| Element: HTMLElement; | ||
| Blocks: {}; | ||
| } | ||
|
|
||
| export default class CodeSnippet extends GlimmerComponent<CodeSnippetSignature> { | ||
| <template> | ||
| <div class='code-snippet-container'> | ||
| <header class='code-snippet-header'> | ||
| <span class='code-snippet-title'>CODE</span> | ||
| <CopyButton | ||
| class='code-snippet-copy-button' | ||
| @textToCopy={{@code}} | ||
| /> | ||
| </header> | ||
| <pre class='code-snippet' data-test-code-snippet>{{@code}}</pre> | ||
| </div> | ||
| <style scoped> | ||
| .code-snippet-container { | ||
| --field-header-bg: var(--boxel-200); | ||
| --field-bg: var(--card, var(--boxel-100)); | ||
| --field-fg: var(--card-foreground, var(--boxel-dark)); | ||
| --field-border: var( | ||
| --border, | ||
| color-mix(in oklab, var(--field-fg) 20%, var(--field-bg)) | ||
| ); | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
| .code-snippet-copy-button { | ||
| margin-left: auto; | ||
| } | ||
| .code-snippet-header { | ||
| border: 1px solid var(--field-border); | ||
| border-bottom: none; | ||
| border-top-left-radius: var(--radius, var(--boxel-border-radius)); | ||
| border-top-right-radius: var(--radius, var(--boxel-border-radius)); | ||
| background-color: var( --field-header-bg); | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| padding: var(--boxel-sp-4xs) var(--boxel-sp-xs); | ||
| } | ||
| .code-snippet-title { | ||
| font-size: var(--boxel-font-size-xs); | ||
| letter-spacing: 0.08em; | ||
| font-weight: 600; | ||
| } | ||
| .code-snippet { | ||
| margin-block: 0; | ||
| padding: var(--boxel-sp); | ||
| background-color: var(--field-bg); | ||
| border: 1px solid var(--field-border); | ||
| border-top: none; | ||
| border-bottom-left-radius: var(--radius, var(--boxel-border-radius)); | ||
| border-bottom-right-radius: var(--radius, var(--boxel-border-radius)); | ||
| border-top-left-radius: 0; | ||
| border-top-right-radius: 0; | ||
| color: var(--field-fg); | ||
| font-family: var( | ||
| --font-mono, | ||
| var(--boxel-monospace-font-family, monospace) | ||
| ); | ||
| font-size: var(--boxel-font-size-xs); | ||
| white-space: pre-wrap; | ||
| word-break: break-word; | ||
| } | ||
| </style> | ||
| </template> | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the
CSSFieldin card-api andCSSValueFieldin base realm. I think the component you want here is similar to those.