UNPKG

schyma

Version:

JSON Schemas Visualizer React component

764 lines (709 loc) 15.2 kB
/* this gets exported as style.css and can be used for the default theming */ /* these are the necessary styles for React Flow, they get used by base.css and style.css */ .body-wrapper{ position: relative; width: 100%; height: 100vh; } .panel-wrapper, .panel-wrapper-collapsed { position: absolute; inset: 0; pointer-events: none; z-index: 10; } .node-container{ width: 100%; height: 100%; display: flex; flex-direction: column; } .panel{ position: absolute; top: 0; right: 0; width: 45%; height: 100%; padding: 6px; background: white; border-left: 1px solid #334155; box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1); z-index: 10; transition: transform 0.2s ease-in-out; pointer-events: auto; } .panel-content { height: 100%; overflow-y: auto; overflow-x: hidden; } .panel-content > h1 { margin: 10px; font-weight: bold; font-size: 25px; } .panel-content > h1::first-letter{ text-transform: uppercase; } .panel-content > p { font-size: 16px; margin: 10px; } .panel_table-wrapper{ position: relative; overflow-x: auto; margin-top: 20px; border-radius: 10px; } .panel_table-wrapper > table { width: 100%; font-size: 14px; text-align: left; } .panel_table-wrapper > table > thead { background-color: #1E293B; color: white; } .panel_table-wrapper > table > thead > tr > th { padding: 15px } .panel_table-wrapper_tbody { border-bottom: 1px solid rgba(128, 128, 128, 0.297); } .panel_table-wrapper_tbody > th { padding: 18px; font-weight: 400; white-space: nowrap; } .panel_table-wrapper_tbody_active{ background: #1E293B; height: 50px; border-bottom: 1px solid rgba(128, 128, 128, 0.297); color: white; } .react-flow__container { position: absolute; width: 100%; height: 100%; top: 0; left: 0; } .react-flow__pane { z-index: 1; cursor: -webkit-grab; cursor: grab; } .react-flow__pane.selection { cursor: pointer; } .react-flow__pane.dragging { cursor: -webkit-grabbing; cursor: grabbing; } .react-flow__viewport { transform-origin: 0 0; z-index: 2; pointer-events: none; } .react-flow__renderer { z-index: 4; } .react-flow__selection { z-index: 6; } .react-flow__nodesselection-rect:focus, .react-flow__nodesselection-rect:focus-visible { outline: none; } .react-flow .react-flow__edges { pointer-events: none; overflow: visible; } .react-flow__edge-path, .react-flow__connection-path { stroke: #b1b1b7; stroke-width: 1; fill: none; } .react-flow__edge { pointer-events: visibleStroke; cursor: pointer; } .react-flow__edge.animated path { stroke-dasharray: 5; -webkit-animation: dashdraw 0.5s linear infinite; animation: dashdraw 0.5s linear infinite; } .react-flow__edge.animated path.react-flow__edge-interaction { stroke-dasharray: none; -webkit-animation: none; animation: none; } .react-flow__edge.inactive { pointer-events: none; } .react-flow__edge.selected, .react-flow__edge:focus, .react-flow__edge:focus-visible { outline: none; } .react-flow__edge.selected .react-flow__edge-path, .react-flow__edge:focus .react-flow__edge-path, .react-flow__edge:focus-visible .react-flow__edge-path { stroke: #555; } .react-flow__edge-textwrapper { pointer-events: all; } .react-flow__edge-textbg { fill: white; } .react-flow__edge .react-flow__edge-text { pointer-events: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; } .react-flow__connection { pointer-events: none; } .react-flow__connection .animated { stroke-dasharray: 5; -webkit-animation: dashdraw 0.5s linear infinite; animation: dashdraw 0.5s linear infinite; } .react-flow__connectionline { z-index: 1001; } .react-flow__nodes { pointer-events: none; transform-origin: 0 0; } .react-flow__node { position: absolute; -webkit-user-select: none; -moz-user-select: none; user-select: none; pointer-events: all; transform-origin: 0 0; box-sizing: border-box; cursor: -webkit-grab; cursor: grab; } .react-flow__node.dragging { cursor: -webkit-grabbing; cursor: grabbing; } .react-flow__nodesselection { z-index: 3; transform-origin: left top; pointer-events: none; } .react-flow__nodesselection-rect { position: absolute; pointer-events: all; cursor: -webkit-grab; cursor: grab; } .react-flow__handle { position: absolute; pointer-events: none; min-width: 5px; min-height: 5px; width: 6px; height: 6px; background: #1a192b; border: 1px solid white; border-radius: 100%; } .react-flow__handle.connectionindicator { pointer-events: all; cursor: crosshair; } .react-flow__handle-bottom { top: auto; left: 50%; bottom: -4px; transform: translate(-50%, 0); } .react-flow__handle-top { left: 50%; top: -4px; transform: translate(-50%, 0); } .react-flow__handle-left { top: 50%; left: -4px; transform: translate(0, -50%); } .react-flow__handle-right { right: -4px; top: 50%; transform: translate(0, -50%); } .react-flow__edgeupdater { cursor: move; pointer-events: all; } .react-flow__panel { position: absolute; z-index: 5; margin: 15px; } .react-flow__panel.top { top: 0; } .react-flow__panel.bottom { bottom: 0; } .react-flow__panel.left { left: 0; } .react-flow__panel.right { right: 0; } .react-flow__panel.center { left: 50%; transform: translateX(-50%); } .react-flow__attribution { display: none; font-size: 10px; background: rgba(255, 255, 255, 0.5); padding: 2px 3px; margin: 0; } .react-flow__attribution a { text-decoration: none; color: #999; } @-webkit-keyframes dashdraw { from { stroke-dashoffset: 10; } } @keyframes dashdraw { from { stroke-dashoffset: 10; } } .react-flow__edgelabel-renderer { position: absolute; width: 100%; height: 100%; pointer-events: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; } .react-flow__edge.updating .react-flow__edge-path { stroke: #777; } .react-flow__edge-text { font-size: 10px; } .react-flow__node.selectable:focus, .react-flow__node.selectable:focus-visible { outline: none; } .react-flow__node-default, .react-flow__node-input, .react-flow__node-output, .react-flow__node-group { padding: 10px; border-radius: 3px; min-width: 150px; max-width: auto; font-size: 12px; color: #222; text-align: center; border-width: 1px; border-style: solid; border-color: #1a192b; background-color: white; } .react-flow__node-default.selectable:hover, .react-flow__node-input.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover { box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08); } .react-flow__node-default.selectable.selected, .react-flow__node-default.selectable:focus, .react-flow__node-default.selectable:focus-visible, .react-flow__node-input.selectable.selected, .react-flow__node-input.selectable:focus, .react-flow__node-input.selectable:focus-visible, .react-flow__node-output.selectable.selected, .react-flow__node-output.selectable:focus, .react-flow__node-output.selectable:focus-visible, .react-flow__node-group.selectable.selected, .react-flow__node-group.selectable:focus, .react-flow__node-group.selectable:focus-visible { box-shadow: 0 0 0 0.5px #1a192b; } .react-flow__node-group { background-color: rgba(240, 240, 240, 0.25); } .react-flow__nodesselection-rect, .react-flow__selection { background: rgba(0, 89, 220, 0.08); border: 1px dotted rgba(0, 89, 220, 0.8); } .react-flow__nodesselection-rect:focus, .react-flow__nodesselection-rect:focus-visible, .react-flow__selection:focus, .react-flow__selection:focus-visible { outline: none; } .react-flow__controls { box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.08); } .react-flow__controls-button { border: none; background: #fefefe; border-bottom: 1px solid #eee; box-sizing: content-box; display: flex; justify-content: center; align-items: center; width: 16px; height: 16px; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; user-select: none; padding: 5px; } .react-flow__controls-button:hover { background: #f4f4f4; } .react-flow__controls-button svg { width: 100%; max-width: 12px; max-height: 12px; } .react-flow__controls-button:disabled { pointer-events: none; } .react-flow__controls-button:disabled svg { fill-opacity: 0.4; } .react-flow__minimap { background-color: #fff; } .react-flow__resize-control { position: absolute; } .react-flow__resize-control.left, .react-flow__resize-control.right { cursor: ew-resize; } .react-flow__resize-control.top, .react-flow__resize-control.bottom { cursor: ns-resize; } .react-flow__resize-control.top.left, .react-flow__resize-control.bottom.right { cursor: nwse-resize; } .react-flow__resize-control.bottom.left, .react-flow__resize-control.top.right { cursor: nesw-resize; } /* handle styles */ .react-flow__resize-control.handle { width: 4px; height: 4px; border: 1px solid #fff; border-radius: 1px; background-color: #3367d9; transform: translate(-50%, -50%); } .react-flow__resize-control.handle.left { left: 0; top: 50%; } .react-flow__resize-control.handle.right { left: 100%; top: 50%; } .react-flow__resize-control.handle.top { left: 50%; top: 0; } .react-flow__resize-control.handle.bottom { left: 50%; top: 100%; } .react-flow__resize-control.handle.top.left { left: 0; } .react-flow__resize-control.handle.bottom.left { left: 0; } .react-flow__resize-control.handle.top.right { left: 100%; } .react-flow__resize-control.handle.bottom.right { left: 100%; } /* line styles */ .react-flow__resize-control.line { border-color: #3367d9; border-width: 0; border-style: solid; } .react-flow__resize-control.line.left, .react-flow__resize-control.line.right { width: 1px; transform: translate(-50%, 0); top: 0; height: 100%; } .react-flow__resize-control.line.left { left: 0; border-left-width: 1px; } .react-flow__resize-control.line.right { left: 100%; border-right-width: 1px; } .react-flow__resize-control.line.top, .react-flow__resize-control.line.bottom { height: 1px; transform: translate(0, -50%); left: 0; width: 100%; } .react-flow__resize-control.line.top { top: 0; border-top-width: 1px; } .react-flow__resize-control.line.bottom { border-bottom-width: 1px; top: 100%; } .panel-code-section { margin-top: 50px; } .main-tabs { display: flex; gap: 0; background-color: #f4f5f8; height: 35px; align-items: stretch; padding-left: 0; position: relative; z-index: 2; } .main-tab { padding: 0 20px; font-size: 12px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace; font-weight: 500; border: none; cursor: pointer; color: #64748b; transition: all 0.15s ease; display: flex; align-items: center; } .main-tab:first-child { padding-left: 26px; } .main-tab-active { background-color: white; color:#439cfd } .main-tab:hover{ color: #439cfd } .examples-wrapper { margin-top: 0; } .json-wrapper { margin-top: 0; } .examples-content { overflow: hidden; } .example-header { background-color: #ffffff; height: 40px; display: flex; align-items: center; padding: 0 6px; margin: 0 -6px; border-bottom: 1px solid #e2e8f0; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06); position: relative; z-index: 1; } .examples-tabs { display: flex; gap: 8px; margin-left: 16px; flex-wrap: wrap; } .examples-tab { padding: 2px 12px; font-size: 13px; background-color: white; border: 1px solid #e2e8f0; border-radius: 4px; cursor: pointer; color: #64748b; transition: all 0.2s ease; } .examples-tab:hover { background-color: #f8fafc; border-color: #cbd5e1; color: #334155; } .examples-tab-active { background-color: #334155; color: white; border-color: #334155; } .examples-tab-active:hover { background-color: #1e293b; border-color: #1e293b; color: white; } .examples-code-container { height: 500px; overflow-y: auto; overflow-x: auto; background-color: #ffffff; } .custom-node { padding: 10px; border-radius: 3px; min-width: 150px; font-size: 12px; color: #222; text-align: center; border: 1px solid #1a192b; background-color: white; position: relative; } .custom-node:hover { box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08); } .custom-node-label { font-weight: 500; } .composition-symbol { position: absolute; top: 50%; right: -6px; transform: translateY(-50%); font-size: 12px; font-weight: bold; cursor: help; background: white; } .composition-tooltip { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); background: #0f172a; color: #f8fafc; font-size: 11px; line-height: 1; padding: 5px 7px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s ease; z-index: 20; } .composition-tooltip::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border-width: 4px; border-style: solid; border-color: #0f172a transparent transparent transparent; } .custom-node:hover .composition-tooltip { opacity: 1; } .required-sentence { font-size: 12px; font-style: italic; color: #6b7280; margin-top: 8px; margin-bottom: 0; } .panel_table-wrapper_tbody_active .required-sentence { color: white; } .rules-block { display: block; margin-top: 6px; padding-bottom: 5px; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; color: #854d0e; } .panel_table-wrapper_tbody_active .rules-block { color: white; } .panel-toggle-btn { position: absolute; top: 10px; right: calc(45% + 8px); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: white; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; color: #64748b; transition: background 0.2s ease, color 0.2s ease; box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1); z-index: 11; pointer-events: auto; } .panel-toggle-btn:hover { background: #f1f5f9; color: #334155; } .panel-wrapper-collapsed .panel-toggle-btn { right: 8px; } .panel-icon-rect { width: 6px; transition: width 0.15s ease-in-out; } .panel-icon-rect-collapsed { width: 3px; } .panel-toggle-btn:hover .panel-icon-rect { width: 3px; } .panel-toggle-btn:hover .panel-icon-rect-collapsed { width: 6px; } .panel-collapsed { transform: translateX(100%); } .panel-wrapper-collapsed .panel-toggle-btn:hover + .panel-collapsed, .panel-wrapper-collapsed .panel-collapsed:hover { transform: translateX(0); } .activity-loader{ display: flex; align-items: center; justify-content: center; min-height: 100vh; width: 100%; }