# open-borders

> TBD

Latest version **0.0.9** (published 2021-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install open-borders
pnpm add open-borders
yarn add open-borders
bun add open-borders
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2021-08-31 |
| First published | 2019-12-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | bahrus |

## Links

- npm: https://www.npmjs.com/package/open-borders
- Repository: https://github.com/bahrus/open-borders
- Homepage: https://github.com/bahrus/open-borders#readme
- Issues: https://github.com/bahrus/open-borders/issues
- npm.io page: https://npm.io/package/open-borders

## Dependencies (3)

- [xtal-shell](https://npm.io/package/xtal-shell.md) 0.0.25
- [trans-render](https://npm.io/package/trans-render.md) 0.0.369
- [xtal-element](https://npm.io/package/xtal-element.md) 0.0.439

## Recent versions

- 0.0.9 (latest) — 2021-08-31
- 0.0.8 — 2021-08-31
- 0.0.7 — 2021-08-30
- 0.0.6 — 2020-07-05
- 0.0.5 — 2020-07-05
- 0.0.4 — 2019-12-11
- 0.0.3 — 2019-12-07
- 0.0.2 — 2019-12-07
- 0.0.1 — 2019-12-07
- 0.0.0 — 2019-12-06

## README

# open-borders
Allow warp travel for templates

Inspired by https://dev.to/westbrook/your-content-in-shadow-dom-portals-3cdb, https://www.npmjs.com/package/portal-vue, https://reactjs.org/docs/portals.html

```html
<open-borders be-born target=... schema=...>
    <template>
        <my-element></my-element>
    </template>
</open-borders>
```

where template must contain a single DOM (custom) element.

does the following:

- [x] Nothing happens until be-born attribute / beBorn property is set (to true).  At that point...
- [x] Clones the template into the location specified by target string
- [ ] If no target string, just clone and append to parent (?) 
- [ ] Changing be-born back to false / true doesn't do anything anymore.
- [x] However, if open-borders tag is removed from DOM, so is traveling my-element.
- [x] Holds on to reference of cloned element.  
- [ ] Cloned element also gets reference to open-border birthplace 
- [ ] Dynamically attaches properties attributes to open-borders tag, based on schema prop (follows custom-elements.json schema). 
- [ ] If addEventListener added to open-borders, actually attaches event listener to remote reference (my-element).
- [ ] If target changes, moves element to new target.

---
_Source: https://npm.io/package/open-borders · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
