Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@senx/discovery-code

Package Overview
Dependencies
Maintainers
0
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@senx/discovery-code

Discovery Code Editor

  • 0.0.38
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Discovery Code

npm version

This web components embed a WarpScript editor dedicated to Warp 10.

Warp 10

Usage

In a Web Environment

With NPM/Yarn
$ npm install @senx/discovery-code
With CDN
<script nomodule src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.esm.js"></script>
Usage

<html lang="en">
<head>
    <title>Test</title>
</head>
<body>
<div style="width: 100%; min-height: calc(100vh - 280px);overflow: hidden;">
  <discovery-code-editor url="https://sandbox.senx.io/api/v0/exec"
                         debug="true" show-dataviz="false"
                         id="editor"
                         show-execute="true" debug
                         show-result="true" config='{}'
                         display-messages="true" initial-size="400">
    NEWGTS 'v' STORE
    0 10 <%
    'ts' STORE
    $v NOW $ts STU * - NaN NaN NaN RAND ADDVALUE DROP
    %> FOR
    $v
  </discovery-code-editor>


</div>
<script nomodule src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@senx/discovery-code/dist/discovery-code/discovery-code.esm.js"></script>
</body>
</html>

Properties

PropertyAttributeDescriptionTypeDefault
codecodestring''
configconfigConfig | stringnew Config()
debugdebugbooleanfalse
displayMessagesdisplay-messagesbooleanfalse
existingCommentsexisting-commentsReviewCommentEvent[] | string[]
heightLineheight-linenumberundefined
heightPxheight-pxnumberundefined
imageTabimage-tabbooleanfalse
initialSize--{ w?: number; h?: number; name?: string; p?: number; }undefined
languagelanguage"flows" | "warpscript"'warpscript'
showDatavizshow-datavizbooleanfalse
showExecuteshow-executebooleanfalse
showResultshow-resultbooleanfalse
themetheme"dark" | "light"'light'
urlurlstringundefined
widthPxwidth-pxnumberundefined

Events

EventDescriptionType
discoveryCodeBreakPointCustomEvent<any>
discoveryCodeChangedCustomEvent<any>
discoveryCodeDatavizCustomEvent<any>
discoveryCodeErrorCustomEvent<any>
discoveryCodeLoadedCustomEvent<any>
discoveryCodeRefCustomEvent<any>
discoveryCodeResultCustomEvent<any>
discoveryCodeReviewCustomEvent<any>
discoveryCodeSizeCustomEvent<any>
discoveryCodeStatusCustomEvent<any>

Methods

abort(session?: string) => Promise<void>

Returns

Type: Promise<void>

execute(session?: string) => Promise<void>

Returns

Type: Promise<void>

highlight(line: number) => Promise<void>

Returns

Type: Promise<void>

resize(initial: boolean) => Promise<void>

Returns

Type: Promise<void>


Data format

Default config

{
  "buttons" : {
    "class": ""
  },
  "execButton" : {
    "class": "",
    "label": "Execute"
  },
  "datavizButton" : {
    "class": "",
    "label": "Visualize"
  },
  "hover" : true,
  "readOnly" : false,
  "messageClass" : "",
  "errorClass" : "",
  "editor": {
    "quickSuggestionsDelay": 10,
    "quickSuggestions": true,
    "tabSize": 2,
    "minLineNumber": 10,
    "enableDebug": false
  }
}

CSS vars

Inherited from Discovery

NameDefault value
--warp-view-button-font-size1rem
--warp-view-button-border-color#004eff
--warp-view-button-padding.375rem .75rem
--warp-view-button-label-color#ffffff
--warp-view-button-bg-color#004eff
--warp-view-button-bg-color#004eff
--warp-view-button-widthauto
--warp-view-button-border-radius0.25rem
--warp-view-spinner-color#004eff

Specific

NameDefault value
--discovery-code-status-bar-font-color#404040
--discovery-code-status-bar-background#c0c0c0
--discovery-code-breakpoint-color#dc3545
--discovery-code-selected-line-color#00abc066

Keywords

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc