open-index/open-npm huggingface dataset:
npm package: @live-codes/lang-minizinc
Description: MiniZinc language support for the CodeMirror code editor
Latest version: 0.1.0

# @live-codes/lang-minizinc [![NPM version](https://img.shields.io/npm/v/@live-codes/lang-minizinc.svg)](https://www.npmjs.org/package/@live-codes/lang-minizinc)

This package implements MiniZinc language support for the
[CodeMirror](https://codemirror.net/) code editor.

The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).

This code is released under an
[MIT license](https://github.com/live-codes/lang-minizinc/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## Usage

```javascript
import { EditorView, basicSetup } from "codemirror";
import { MiniZinc } from "@live-codes/lang-minizinc";

const code = `
include "all_different.mzn";

int: n = 8;
array [1..n] of var 1..n: q; % queen in column i is in row q[i]

constraint all_different(q);                      % distinct rows
constraint all_different([q[i] + i | i in 1..n]); % distinct diagonals
constraint all_different([q[i] - i | i in 1..n]); % upwards+downwards
`;

const view = new EditorView({
  parent: document.body,
  doc: code,
  extensions: [basicSetup, MiniZinc()],
});
```

## API Reference

<dl>
<dt id="user-content-minizinc">
  <code><strong><a href="#user-content-minizinc">MiniZinc</a></strong>() → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>

<dd><p>Language support for MiniZinc.</p>
</dd>
<dt id="user-content-minizinclanguage">
  <code><strong><a href="#user-content-minizinclanguage">MiniZincLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>

<dd><p>A language provider for MiniZinc with highlighting and indentation information.</p>
</dd>
</dl>
npm package: @live-codes/monaco-codeium-provider
Description: AI auto-completion provider for Monaco editor powered by Codeium
Latest version: 0.2.2

# Monaco Codeium Provider

AI auto-completion provider for Monaco editor powered by Codeium.

As used in [LiveCodes](https://livecodes.io).

Based on https://github.com/Exafunction/codeium-react-code-editor ([MIT License](https://github.com/Exafunction/codeium-react-code-editor/blob/cf3f020b3bf518bd1683f0b31df578e50ef93407/LICENSE))

## Installation

```bash
npm install @live-codes/monaco-codeium-provider
```

## Usage

```js
import { registerCodeiumProvider } from "@live-codes/monaco-codeium-provider";

const provider = registerCodeiumProvider(
  monaco,
  // optional config
  {
    languageServer: "https://web-backend.codeium.com",
    apiKey: "codeium-api-key",
    onAutocomplete: (acceptedText) => {
      // runs on completion
      console.log(acceptedText);
    },
    getEditors: () => {
      // return an array of other monaco editors that you want their content to be used for AI context
      // e.g. if the current editor is for JS, return HTML and CSS editors
      return [];
    },
  }
);

// to dispose
provider.dispose();
```
npm package: @live-codes/monaco-editor
Description: A patched version of Monaco Editor which allows specifying the TypeScript version to use
Author: Hatem Hosny
Latest version: 0.3.1

# Monaco Editor

This is patched version of [Monaco Editor](https://github.com/microsoft/monaco-editor) which allows specifying the TypeScript version to use. It is based on [TypeScript-Make-Monaco-Builds](https://github.com/microsoft/TypeScript-Make-Monaco-Builds) which builds the editor used for the [TypeScript playground](https://www.typescriptlang.org/play).

This was built for use in [LiveCodes](https://livecodes.io/).

## Usage

The editor is bundled as ESM. It can be used like this:

[try in LiveCodes](https://livecodes.io/?x=id/nug2m5cf3ms)

```html
<div id="container" style="height: 200px;"></div>

<script type="module">
  import { monaco } from "https://cdn.jsdelivr.net/npm/@live-codes/monaco-editor/monaco.js";

  const editor = monaco.editor.create(document.getElementById("container"), {
    value: `function x() {\n\tconsole.log("Hello world!");\n}`,
    language: "javascript",
  });
</script>
```

Alternatively, the base URL can be specified:

```ts
import { loadMonaco } from "https://cdn.jsdelivr.net/npm/@live-codes/monaco-editor/load-monaco.js";

const baseUrl = "https://cdn.jsdelivr.net/npm/@live-codes/monaco-editor/dist/";
const monaco = await loadMonaco(baseUrl);
```

## Build

```bash
npm run build
```

By default, this uses the latest TypeScript version. You can specify the version/tag to use by passing it as an argument:

```bash
npm run build 5.4.5
npm run build next
```
npm package: @live-codes/monaco-volar
Description: Vue support for monaco editor for use in livecodes.io
Latest version: 0.1.0

# @live-codes/monaco-volar

Vue support for monaco editor for use in [LiveCodes](https://livecodes.io).

Based on [Vue REPL](https://github.com/vuejs/repl/tree/main/src/monaco).

## Demo

https://livecodes.io?template=vue

## Usage

See [demo.ts](https://github.com/live-codes/monaco-volar/blob/main/demo/demo.ts)

## License

MIT
npm package: @live-codes/playground-sandbox
Description: A sandbox for safely running untrusted code in playgrounds
Author: Hatem Hosny
Latest version: 1.0.0

# Playground Sandbox

This repo contains a web page that can be used as a sandbox for running untrusted code in playgrounds (similar to [livecodes.io](https://livecodes.io)).

## Usage

The page "[index.html](./index.html)" is used as the `src` for a [sandboxed iframe](https://web.dev/articles/sandboxed-iframes) in which untrusted code can be executed. This page has to be on a different domain than the playground. That's why it is published to npm, so that it can be hosted on CDNs (e.g. unpkg).

The html is sent to the iframe using [`postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) in an object with the `html` key.

Example:

```js
const iframe = document.createElement("iframe");
iframe.src =
  "https://unpkg.com/@live-codes/playground-sandbox@1.0.0/index.html";
iframe.setAttribute(
  "sandbox",
  "allow-same-origin allow-forms allow-scripts allow-modals" // and whatever else you need
);
iframe.onload = function () {
  iframe.contentWindow.postMessage(
    {
      html: `
        <h1>hello world!</h1>
        I do not have access to the parent window except through \`postMessage\`.
    `,
    },
    "*"
  );
};
document.body.appendChild(iframe);
```

## License

MIT License
npm package: @live-codes/postcss-import-url
Description: PostCSS plugin inlines remote files, for in-browser use in livecodes.io
Latest version: 0.1.2

# postcss-import-url
[PostCSS](https://github.com/postcss/postcss) plugin inlines remote files, for in-browser use in [livecodes.io](https://livecodes.io).
This is a fork of [postcss-import-url](https://github.com/unlight/postcss-import-url) with same API. It adds caching to prevent re-fetching the same url (can be disabled in options).
```c
/* Input example */
@import 'https://fonts.googleapis.com/css?family=Tangerine';
body 
  font-size: 13px;

`
`s
/* Output example */
@font-face {
  font-family: 'Tangerine';
  font-style: normal;
  font-weight: 400;
  src: url(https://fonts.gstatic.com/s/tangerine/v12/IurY6Y5j_oScZZow4VOxCZZM.woff2) format('woff2');

body
  font-size: 13px;

`
## Options
- `disableCache` (boolean) disable caching url content (default: `false`)
- `recursive` (boolean) To import URLs recursively (default: `true`)
- `resolveUrls` (boolean) To transform relative URLs found in remote stylesheets into fully qualified URLs ([see #18](https://github.com/unlight/postcss-import-url/pull/18)) (default: `false`)
- `modernBrowser` (boolean) Set user-agent string to 'Mozilla/5.0 AppleWebKit/537.36 Chrome/80.0.0.0 Safari/537.36', this option maybe useful for importing fonts from Google. Google check `user-agent` header string and respond can be different (default: `false`)
- `userAgent` (string) Custom user-agent header (default: `null`)
npm package: @live-codes/prettier-plugin-minizinc
Description: Prettier plugin for MiniZinc
Author: Hatem Hosny
Latest version: 0.2.0

# @live-codes/prettier-plugin-minizinc

A Prettier plugin for [MiniZinc](https://www.minizinc.org).

As used in [live-codes](https://livecodes.io).

## Installation

```bash
npm install @live-codes/prettier-plugin-minizinc
```

## Usage

```js
import prettier from "prettier";
import minizinc from "@live-codes/prettier-plugin-minizinc";

const code = `int: n = 8;`;

console.log(
  prettier.format(code, {
    parser: "minizinc",
    plugins: [minizinc],
  })
);
```

Standalone:

```js
import prettier from "https://cdn.jsdelivr.net/npm/prettier/esm/standalone.mjs";
import "https://cdn.jsdelivr.net/npm/@live-codes/prettier-plugin-minizinc/dist/standalone.js";

const code = `int: n = 8;`;

console.log(
  prettier.format(code, {
    parser: "minizinc",
    plugins: [prettierPlugins.minizinc],
  })
);
```

## License

MIT
npm package: @live-codes/solid-sdk
Description: Solid SDK for LiveCodes
Author: Hatem Hosny
Latest version: 0.5.0

<p>
  <img width="100%" src="https://assets.solidjs.com/banner?type=@live-codes/solid-sdk&background=tiles&project=%20" alt="@live-codes/solid-sdk">
</p>

# @live-codes/solid-sdk

[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/)

Solid SDK for LiveCodes