├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .npmignore ├── .travis.yml ├── .yarn └── releases │ └── yarn-4.6.0.cjs ├── .yarnrc.yml ├── LICENSE.md ├── README.md ├── docs ├── coverage.html ├── dependencies.html ├── fonts │ ├── ionicons.eot │ ├── ionicons.svg │ ├── ionicons.ttf │ ├── ionicons.woff │ ├── ionicons.woff2 │ ├── roboto-v15-latin-300.eot │ ├── roboto-v15-latin-300.svg │ ├── roboto-v15-latin-300.ttf │ ├── roboto-v15-latin-300.woff │ ├── roboto-v15-latin-300.woff2 │ ├── roboto-v15-latin-700.eot │ ├── roboto-v15-latin-700.svg │ ├── roboto-v15-latin-700.ttf │ ├── roboto-v15-latin-700.woff │ ├── roboto-v15-latin-700.woff2 │ ├── roboto-v15-latin-italic.eot │ ├── roboto-v15-latin-italic.svg │ ├── roboto-v15-latin-italic.ttf │ ├── roboto-v15-latin-italic.woff │ ├── roboto-v15-latin-italic.woff2 │ ├── roboto-v15-latin-regular.eot │ ├── roboto-v15-latin-regular.svg │ ├── roboto-v15-latin-regular.ttf │ ├── roboto-v15-latin-regular.woff │ └── roboto-v15-latin-regular.woff2 ├── graph │ └── dependencies.svg ├── images │ ├── compodoc-vectorise-inverted.png │ ├── compodoc-vectorise-inverted.svg │ ├── compodoc-vectorise.png │ ├── compodoc-vectorise.svg │ ├── coverage-badge-documentation.svg │ └── favicon.ico ├── index.html ├── injectables │ ├── SegmentService.html │ └── WindowWrapper.html ├── interfaces │ ├── SegmentConfig.html │ └── SegmentPlugin.html ├── js │ ├── compodoc.js │ ├── lazy-load-graphs.js │ ├── libs │ │ ├── EventDispatcher.js │ │ ├── bootstrap-native.js │ │ ├── clipboard.min.js │ │ ├── custom-elements-es5-adapter.js │ │ ├── custom-elements.min.js │ │ ├── d3.v3.min.js │ │ ├── deep-iterator.js │ │ ├── es6-shim.min.js │ │ ├── htmlparser.js │ │ ├── innersvg.js │ │ ├── lit-html.js │ │ ├── prism.js │ │ ├── promise.min.js │ │ ├── svg-pan-zoom.min.js │ │ ├── tablesort.min.js │ │ ├── tablesort.number.min.js │ │ ├── vis.min.js │ │ └── zepto.min.js │ ├── menu-wc.js │ ├── menu-wc_es5.js │ ├── menu.js │ ├── routes.js │ ├── search │ │ ├── lunr.min.js │ │ ├── search-lunr.js │ │ ├── search.js │ │ └── search_index.js │ ├── sourceCode.js │ ├── svg-pan-zoom.controls.js │ ├── tabs.js │ └── tree.js ├── license.html ├── miscellaneous │ ├── functions.html │ ├── typealiases.html │ └── variables.html ├── modules.html ├── modules │ └── SegmentModule.html ├── overview.html ├── properties.html └── styles │ ├── bootstrap-card.css │ ├── bootstrap.min.css │ ├── compodoc.css │ ├── dark.css │ ├── ionicons.min.css │ ├── laravel.css │ ├── material.css │ ├── original.css │ ├── postmark.css │ ├── prism.css │ ├── readthedocs.css │ ├── reset.css │ ├── stripe.css │ ├── style.css │ ├── tablesort.css │ └── vagrant.css ├── eslint.config.mjs ├── package.json ├── src ├── .yarn │ └── install-state.gz ├── README.md ├── index.ts ├── ng-package.json ├── ngx-segment-analytics.config.ts ├── ngx-segment-analytics.module.ts ├── ngx-segment-analytics.service.ts ├── package.json ├── window-wrapper.ts └── yarn.lock ├── tsconfig.json └── yarn.lock /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | ### Bug Report or Feature Request (mark with an `x`) 5 | ``` 6 | - [ ] bug report -> please search issues before submitting 7 | - [ ] feature request 8 | ``` 9 | 10 | ### OS and Version? 11 | 14 | 15 | ### Generator Version 16 | 19 | 20 | ### Tools Version 21 | 26 | 27 | ### Targeted Angular version 28 | 29 | 30 | ### Repro steps. 31 | 36 | 37 | ### The log given by the failure. 38 | 39 | 40 | ### Desired functionality. 41 | 45 | 46 | ### Mention any other details that might be useful. 47 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Your checklist for this pull request 2 | 3 | - [ ] Make sure you are requesting to **pull a topic/feature/bugfix branch** (right side). Don't request your master! 4 | - [ ] Make sure you are making a pull request against the **canary branch** (left side). Also you should start *your branch* off *our canary*. 5 | - [ ] Check the commit's or even all commits' message styles matches our requested structure. 6 | - [ ] Check your code additions will fail neither code linting checks nor unit test. 7 | 8 | ### Description 9 | Please describe your pull request. 10 | 11 | 💔Thank you! -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Node 2 | node_modules 3 | npm-debug.log 4 | .pnp.* 5 | .yarn/* 6 | !.yarn/patches 7 | !.yarn/plugins 8 | !.yarn/releases 9 | !.yarn/sdks 10 | !.yarn/versions 11 | /node_modules/ 12 | 13 | # TypeScript 14 | src/*.js 15 | src/*.map 16 | src/*.d.ts 17 | 18 | # JetBrains 19 | .idea 20 | .project 21 | .settings 22 | .idea/* 23 | *.iml 24 | 25 | # VS Code 26 | .vscode/* 27 | 28 | # Windows 29 | Thumbs.db 30 | Desktop.ini 31 | 32 | # Mac 33 | .DS_Store 34 | **/.DS_Store 35 | 36 | # Ngc generated files 37 | **/*.ngfactory.ts 38 | 39 | # Build files 40 | dist 41 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Node 2 | node_modules 3 | npm-debug.log 4 | docs 5 | # DO NOT IGNORE TYPESCRIPT FILES FOR NPM 6 | # TypeScript 7 | # *.js 8 | # *.map 9 | # *.d.ts 10 | 11 | # JetBrains 12 | .idea 13 | .project 14 | .settings 15 | *.iml 16 | 17 | # VS Code 18 | .vscode/* 19 | 20 | # Windows 21 | Thumbs.db 22 | Desktop.ini 23 | 24 | # Mac 25 | .DS_Store 26 | 27 | # Ngc generated files 28 | **/*.ngfactory.ts 29 | 30 | # Library files 31 | src/* 32 | build/* 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | node_js: 4 | - 16 5 | - 18 6 | - 20 7 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | 3 | yarnPath: .yarn/releases/yarn-4.6.0.cjs 4 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 OpenDecide 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ngx-segment-analytics 2 | 3 | [![Build Status](https://travis-ci.org/opendecide/ngx-segment-analytics.svg?branch=master)](https://travis-ci.org/opendecide/ngx-segment-analytics) 4 | [![GitHub Downloads All Releases](https://img.shields.io/github/downloads/opendecide/ngx-segment-analytics/total.svg)](https://github.com/opendecide/ngx-segment-analytics) 5 | [![npm Downloads All Releases](https://img.shields.io/npm/dw/ngx-segment-analytics.svg)](https://www.npmjs.com/package/ngx-segment-analytics) 6 | [![npm Version](https://img.shields.io/npm/v/ngx-segment-analytics.svg)](https://www.npmjs.com/package/ngx-segment-analytics) 7 | [![node Version Required](https://img.shields.io/node/v/ngx-segment-analytics.svg)](https://www.npmjs.com/package/ngx-segment-analytics) 8 | [![Angular Universal Compatible](https://img.shields.io/badge/angular-universal-brightgreen.svg)](https://universal.angular.io/) 9 | 10 | This Angular module provides an API for Segment using the `analytics.js` official library. 11 | 12 | Compatible with Angular AOT and Universal. 13 | 14 | ## Installation 15 | 16 | To install this library, run: 17 | 18 | ```bash 19 | $ npm install --save ngx-segment-analytics 20 | ``` 21 | 22 | ## Consuming Segment 23 | 24 | Add the `SegmentModule` to your Angular `AppModule`: 25 | 26 | ```typescript 27 | import { BrowserModule } from '@angular/platform-browser'; 28 | import { NgModule } from '@angular/core'; 29 | 30 | import { AppComponent } from './app.component'; 31 | 32 | // Import the Segment module 33 | import { SegmentModule } from 'ngx-segment-analytics'; 34 | 35 | @NgModule({ 36 | declarations: [ 37 | AppComponent 38 | ], 39 | imports: [ 40 | BrowserModule, 41 | // Segment Importation 42 | SegmentModule.forRoot({ apiKey: 'YOUR_WRITE_APIKEY', debug: true, loadOnInitialization: true }) 43 | ], 44 | providers: [], 45 | bootstrap: [AppComponent] 46 | }) 47 | export class AppModule { } 48 | ``` 49 | 50 | You can use the `SegmentService` in any constructor as a injected service : 51 | 52 | ```typescript 53 | import { Component, OnInit } from '@angular/core'; 54 | import { SegmentService } from 'ngx-segment-analytics'; 55 | @Component({ 56 | selector: 'hero', 57 | templateUrl: './hero.component.html', 58 | styleUrls: ['./hero.component.css'] 59 | }) 60 | export class HeroComponent implements OnInit { 61 | 62 | constructor(private segment: SegmentService) { } 63 | 64 | public ngOnInit() { 65 | this.segment.track('load an hero') 66 | .then(() => console.log("Event sended")); 67 | } 68 | 69 | } 70 | ``` 71 | 72 | ## Documentation 73 | 74 | A full documentation is available [here](https://opendecide.github.io/ngx-segment-analytics/) 75 | 76 | ## API 77 | 78 | This API is compatible with `analytics.js` but returns `Promises` instead of taking `callbacks` in parameters. 79 | 80 | ```typescript 81 | load(apiKey: string, options: any); 82 | get plugins: {[pluginName :string]: SegmentPlugin}; 83 | identify(userId?: string, traits?: any, options?: any): Promise; 84 | track(event: string, properties?: any, options?: any): Promise; 85 | page(category?: string, name?: string, properties?: any, options?: any): Promise; 86 | group(groupId: string, traits?: any): Promise; 87 | alias(userId: string, previousId?: string, options?: any): Promise; 88 | ready(): Promise; 89 | user(): any; 90 | id(): any; 91 | traits(): any; 92 | reset(): void; 93 | debug(enabled?: boolean): void; 94 | on(method: string, callback: (event?: string, properties?: any, options?: any) => any): void; 95 | trackLink(elements: HTMLElement | HTMLElement[], event: string | Function, properties?: Object | Function): void; 96 | trackForm(forms: HTMLElement | HTMLElement[], event: string | Function, properties?: Object | Function): void; 97 | timeout(timeout: number): void; 98 | addSourceMiddleware(middleware: ({integrations, payload, next}) => void): void; 99 | ``` 100 | 101 | ## Development 102 | 103 | To lint all `*.ts` files: 104 | 105 | ```bash 106 | $ npm run lint 107 | ``` 108 | 109 | To generate all `*.js`, `*.d.ts` and `*.metadata.json` files: 110 | 111 | ```bash 112 | $ npm run build 113 | ``` 114 | 115 | To publish on npmjs registry : 116 | ```bash 117 | $ npm publish dist 118 | ``` 119 | 120 | 121 | ## License 122 | 123 | MIT ©2019 [OpenDecide](https://www.opendecide.com) 124 | -------------------------------------------------------------------------------- /docs/dependencies.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 24 | 25 |
26 |
27 | 30 | 31 |
32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 51 |
    52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

results matching ""

62 |
    63 |
    64 |
    65 |

    No results matching ""

    66 |
    67 |
    68 |
    69 | 70 |
    71 |
    72 | 73 | 81 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /docs/fonts/ionicons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/ionicons.eot -------------------------------------------------------------------------------- /docs/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/ionicons.ttf -------------------------------------------------------------------------------- /docs/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/ionicons.woff -------------------------------------------------------------------------------- /docs/fonts/ionicons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/ionicons.woff2 -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-300.eot -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-300.ttf -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-300.woff -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-300.woff2 -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-700.eot -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-700.ttf -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-700.woff -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-700.woff2 -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-italic.eot -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-italic.ttf -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-italic.woff -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-italic.woff2 -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-regular.eot -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-regular.ttf -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-regular.woff -------------------------------------------------------------------------------- /docs/fonts/roboto-v15-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/fonts/roboto-v15-latin-regular.woff2 -------------------------------------------------------------------------------- /docs/graph/dependencies.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | dependencies 11 | 12 | Legend 13 | 14 |  Declarations 15 | 16 |  Module 17 | 18 |  Bootstrap 19 | 20 |  Providers 21 | 22 |  Exports 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/images/compodoc-vectorise-inverted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/images/compodoc-vectorise-inverted.png -------------------------------------------------------------------------------- /docs/images/compodoc-vectorise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/images/compodoc-vectorise.png -------------------------------------------------------------------------------- /docs/images/coverage-badge-documentation.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | documentation 7 | 42% 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/docs/images/favicon.ico -------------------------------------------------------------------------------- /docs/injectables/WindowWrapper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
    77 |
    78 | 81 | 82 |
    83 |
    84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 96 | 97 | 111 | 112 |
    113 |
    114 |

    115 |

    File

    116 |

    117 |

    118 | src/window-wrapper.ts 119 |

    120 | 121 | 122 |

    123 |

    Description

    124 |

    125 |

    126 |

    Window Wrapper for Angular AOT

    127 | 128 |

    129 | 130 | 131 | 132 |
    133 |

    Index

    134 | 135 | 136 | 137 | 140 | 141 | 142 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 |
    138 |
    Properties
    139 |
    143 |
      144 |
    • 145 | Public 146 | analytics 147 |
    • 148 |
    149 |
    159 |
    160 | 161 | 162 | 163 |
    164 | 165 |

    166 | Properties 167 |

    168 | 169 | 170 | 171 | 179 | 180 | 181 | 185 | 186 | 187 | 190 | 191 | 192 | 193 | 197 | 198 | 199 | 200 |
    172 | 173 | 174 | Public 175 | analytics 176 | 177 | 178 |
    182 | Type : AnalyticsSnippet 183 | 184 |
    188 | 189 |
    194 |

    Segment Analytics.js instance

    195 |
    196 |
    201 |
    202 | 203 |
    204 | 205 | 206 |
    207 |
    import {Injectable} from '@angular/core';
    208 | import type { AnalyticsSnippet } from '@segment/analytics-next';
    209 | 
    210 | /**
    211 |  * Window Wrapper for Angular AOT
    212 |  */
    213 | @Injectable()
    214 | export class WindowWrapper {
    215 |     /** Segment Analytics.js instance */
    216 |     public analytics: AnalyticsSnippet;
    217 | }
    218 | 
    219 |
    220 | 221 |
    222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 |
    236 |
    237 |

    results matching ""

    238 |
      239 |
      240 |
      241 |

      No results matching ""

      242 |
      243 |
      244 |
      245 | 246 |
      247 |
      248 | 249 | 257 | 258 | 264 | 265 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | -------------------------------------------------------------------------------- /docs/js/compodoc.js: -------------------------------------------------------------------------------- 1 | var compodoc = { 2 | EVENTS: { 3 | READY: 'compodoc.ready', 4 | SEARCH_READY: 'compodoc.search.ready' 5 | } 6 | }; 7 | 8 | Object.assign( compodoc, EventDispatcher.prototype ); 9 | 10 | document.addEventListener('DOMContentLoaded', function() { 11 | compodoc.dispatchEvent({ 12 | type: compodoc.EVENTS.READY 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /docs/js/lazy-load-graphs.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | var lazyGraphs = [].slice.call(document.querySelectorAll('[lazy]')); 3 | var active = false; 4 | 5 | var lazyLoad = function() { 6 | if (active === false) { 7 | active = true; 8 | 9 | setTimeout(function() { 10 | lazyGraphs.forEach(function(lazyGraph) { 11 | if ( 12 | lazyGraph.getBoundingClientRect().top <= window.innerHeight && 13 | lazyGraph.getBoundingClientRect().bottom >= 0 && 14 | getComputedStyle(lazyGraph).display !== 'none' 15 | ) { 16 | lazyGraph.data = lazyGraph.getAttribute('lazy'); 17 | lazyGraph.removeAttribute('lazy'); 18 | 19 | lazyGraphs = lazyGraphs.filter(function(image) { return image !== lazyGraph}); 20 | 21 | if (lazyGraphs.length === 0) { 22 | document.removeEventListener('scroll', lazyLoad); 23 | window.removeEventListener('resize', lazyLoad); 24 | window.removeEventListener('orientationchange', lazyLoad); 25 | } 26 | } 27 | }); 28 | 29 | active = false; 30 | }, 200); 31 | } 32 | }; 33 | 34 | // initial load 35 | lazyLoad(); 36 | 37 | var container = document.querySelector('.container-fluid.modules'); 38 | if (container) { 39 | container.addEventListener('scroll', lazyLoad); 40 | window.addEventListener('resize', lazyLoad); 41 | window.addEventListener('orientationchange', lazyLoad); 42 | } 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /docs/js/libs/EventDispatcher.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author mrdoob / http://mrdoob.com/ 3 | */ 4 | 5 | var EventDispatcher=function(){};Object.assign(EventDispatcher.prototype,{addEventListener:function(i,t){void 0===this._listeners&&(this._listeners={});var e=this._listeners;void 0===e[i]&&(e[i]=[]),-1===e[i].indexOf(t)&&e[i].push(t)},hasEventListener:function(i,t){if(void 0===this._listeners)return!1;var e=this._listeners;return void 0!==e[i]&&-1!==e[i].indexOf(t)},removeEventListener:function(i,t){if(void 0!==this._listeners){var e=this._listeners[i];if(void 0!==e){var s=e.indexOf(t);-1!==s&&e.splice(s,1)}}},dispatchEvent:function(i){if(void 0!==this._listeners){var t=this._listeners[i.type];if(void 0!==t){i.target=this;var e=[],s=0,n=t.length;for(s=0;s0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])}); -------------------------------------------------------------------------------- /docs/js/libs/custom-elements-es5-adapter.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license @nocompile 3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | (function () { 11 | 'use strict'; 12 | 13 | (function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.hasOwnProperty('polyfillWrapFlushCallback'))return;const a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)},HTMLElement.prototype=a.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,a);})(); 14 | 15 | }()); 16 | -------------------------------------------------------------------------------- /docs/js/libs/innersvg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * innerHTML property for SVGElement 3 | * Copyright(c) 2010, Jeff Schiller 4 | * 5 | * Licensed under the Apache License, Version 2 6 | * 7 | * Minor modifications by Chris Price to only polyfill when required. 8 | */ 9 | !function(e){if(e&&!("innerHTML"in e.prototype)){var t=function(e,r){var i=e.nodeType;if(3==i)r.push(e.textContent.replace(/&/,"&").replace(/",">"));else if(1==i){if(r.push("<",e.tagName),e.hasAttributes())for(var n=e.attributes,s=0,o=n.length;s");for(var h=e.childNodes,s=0,o=h.length;s")}else r.push("/>")}else{if(8!=i)throw"Error serializing XML. Unhandled node of type: "+i;r.push("\x3c!--",e.nodeValue,"--\x3e")}};Object.defineProperty(e.prototype,"innerHTML",{get:function(){for(var e=[],r=this.firstChild;r;)t(r,e),r=r.nextSibling;return e.join("")},set:function(e){for(;this.firstChild;)this.removeChild(this.firstChild);try{var t=new DOMParser;t.async=!1,sXML=""+e+"";for(var r=t.parseFromString(sXML,"text/xml").documentElement.firstChild;r;)this.appendChild(this.ownerDocument.importNode(r,!0)),r=r.nextSibling}catch(e){throw new Error("Error parsing XML string")}}})}}((0,eval)("this").SVGElement); -------------------------------------------------------------------------------- /docs/js/libs/promise.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2013 (c) Pierre Duquesne 3 | * Licensed under the New BSD License. 4 | * https://github.com/stackp/promisejs 5 | */ 6 | (function(a){function b(){this._callbacks=[];}b.prototype.then=function(a,c){var d;if(this._isdone)d=a.apply(c,this.result);else{d=new b();this._callbacks.push(function(){var b=a.apply(c,arguments);if(b&&typeof b.then==='function')b.then(d.done,d);});}return d;};b.prototype.done=function(){this.result=arguments;this._isdone=true;for(var a=0;a=300)&&j.status!==304);h.done(a,j.responseText,j);}};j.send(k);return h;}function h(a){return function(b,c,d){return g(a,b,c,d);};}var i={Promise:b,join:c,chain:d,ajax:g,get:h('GET'),post:h('POST'),put:h('PUT'),del:h('DELETE'),ENOXHR:1,ETIMEOUT:2,ajaxTimeout:0};if(typeof define==='function'&&define.amd)define(function(){return i;});else a.promise=i;})(this); -------------------------------------------------------------------------------- /docs/js/libs/tablesort.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * tablesort v5.2.1 (2021-10-30) 3 | * http://tristen.ca/tablesort/demo/ 4 | * Copyright (c) 2021 ; Licensed MIT 5 | */ 6 | !function(){function a(b,c){if(!(this instanceof a))return new a(b,c);if(!b||"TABLE"!==b.tagName)throw new Error("Element must be a table");this.init(b,c||{})}var b=[],c=function(a){var b;return window.CustomEvent&&"function"==typeof window.CustomEvent?b=new CustomEvent(a):(b=document.createEvent("CustomEvent"),b.initCustomEvent(a,!1,!1,void 0)),b},d=function(a,b){return a.getAttribute(b.sortAttribute||"data-sort")||a.textContent||a.innerText||""},e=function(a,b){return a=a.trim().toLowerCase(),b=b.trim().toLowerCase(),a===b?0:a0)if(a.tHead&&a.tHead.rows.length>0){for(e=0;e0&&n.push(m),o++;if(!n)return}for(o=0;o 16 | 115 | 116 | `); 117 | this.innerHTML = tp.strings; 118 | } 119 | }); -------------------------------------------------------------------------------- /docs/js/menu-wc_es5.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } 4 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } 5 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } 6 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } 7 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } 8 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } 9 | function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } 10 | function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } 11 | function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } 12 | function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } 13 | function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); } 14 | function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; } 15 | function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } 16 | function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } } 17 | function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } 18 | function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } 19 | customElements.define('compodoc-menu', /*#__PURE__*/function (_HTMLElement) { 20 | function _class() { 21 | var _this; 22 | _classCallCheck(this, _class); 23 | _this = _callSuper(this, _class); 24 | _this.isNormalMode = _this.getAttribute('mode') === 'normal'; 25 | return _this; 26 | } 27 | _inherits(_class, _HTMLElement); 28 | return _createClass(_class, [{ 29 | key: "connectedCallback", 30 | value: function connectedCallback() { 31 | this.render(this.isNormalMode); 32 | } 33 | }, { 34 | key: "render", 35 | value: function render(isNormalMode) { 36 | var tp = lithtml.html("\n \n ")); 37 | this.innerHTML = tp.strings; 38 | } 39 | }]); 40 | }(/*#__PURE__*/_wrapNativeSuper(HTMLElement))); -------------------------------------------------------------------------------- /docs/js/routes.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function () { 2 | function htmlEntities(str) { 3 | return String(str) 4 | .replace(/&/g, '&') 5 | .replace(//g, '>') 7 | .replace(/"/g, '"'); 8 | } 9 | 10 | function foundLazyModuleWithPath(path) { 11 | //path is like app/customers/customers.module#CustomersModule 12 | var split = path.split('#'), 13 | lazyModulePath = split[0], 14 | lazyModuleName = split[1]; 15 | return lazyModuleName; 16 | } 17 | 18 | function getBB(selection) { 19 | selection.each(function (d) { 20 | d.bbox = this.getBBox(); 21 | }); 22 | } 23 | 24 | var test_cases, test_case, test_case_num, engine; 25 | 26 | var tree = ROUTES_INDEX; 27 | 28 | function cleanStringChildren(obj) { 29 | for (var property in obj) { 30 | if (obj.hasOwnProperty(property)) { 31 | if (property === 'children' && typeof obj[property] === 'object') { 32 | for (var i = obj[property].length - 1; i >= 0; i--) { 33 | if (typeof obj[property][i] === 'string') { 34 | obj[property].splice(i, 1); 35 | } 36 | } 37 | } 38 | if (typeof obj[property] === 'object') { 39 | cleanStringChildren(obj[property]); 40 | } 41 | } 42 | } 43 | } 44 | cleanStringChildren(tree); 45 | 46 | engine = d3.layout.tree().setNodeSizes(true); 47 | 48 | engine.spacing(function (a, b) { 49 | return a.parent == b.parent ? 0 : engine.rootXSize(); 50 | }); 51 | 52 | engine.nodeSize(function (d) { 53 | return [ 54 | document.getElementById(d.id).getBBox()['height'] + 70, 55 | document.getElementById(d.id).getBBox()['width'] + 30 56 | ]; 57 | }); 58 | 59 | var nodes = d3.layout.hierarchy()(tree), 60 | svg = d3.select('#body-routes').append('svg'), 61 | svg_g = svg.append('g'), 62 | svg_p = svg.append('g'), 63 | last_id = 0, 64 | node = svg_g 65 | .selectAll('.node') 66 | .data(nodes, function (d) { 67 | return d.id || (d.id = ++last_id); 68 | }) 69 | .enter() 70 | .append('g') 71 | .attr('class', 'node'); 72 | 73 | svg.attr('id', 'main'); 74 | 75 | svg_g.attr('transform', 'translate(20,0)').attr('id', 'main-group'); 76 | 77 | svg_p.attr('transform', 'translate(20,0)').attr('id', 'paths'); 78 | 79 | var infos_group = node.append('g').attr({ 80 | id: function (d) { 81 | return d.id; 82 | }, 83 | dx: 0, 84 | dy: 0 85 | }); 86 | 87 | //Node icon 88 | infos_group 89 | .append('text') 90 | .attr('font-family', 'Ionicons') 91 | .attr('y', 5) 92 | .attr('x', 0) 93 | .attr('class', function (d) { 94 | return d.children || d._children ? 'icon has-children' : 'icon'; 95 | }) 96 | .attr('font-size', function (d) { 97 | return '15px'; 98 | }) 99 | .text(function (d) { 100 | return '\uf183'; 101 | }); 102 | 103 | //node infos 104 | infos_group 105 | .append('svg:text') 106 | .attr('x', function (d) { 107 | return 0; 108 | }) 109 | .attr('y', function (d) { 110 | return 10; 111 | }) 112 | .attr('dy', '.35em') 113 | .attr('class', 'text') 114 | .attr('text-anchor', function (d) { 115 | return 'start'; 116 | }) 117 | .html(function (d) { 118 | // if kind === module name + module 119 | // if kind === component component + path 120 | var _name = ''; 121 | if (d.kind === 'module') { 122 | if (d.module) { 123 | _name += 124 | '' + 127 | d.module + 128 | ''; 129 | if (d.name) { 130 | _name += '' + d.name + ''; 131 | } 132 | } else { 133 | _name += '' + htmlEntities(d.name) + ''; 134 | } 135 | } else if (d.kind === 'component') { 136 | _name += '' + d.path + ''; 137 | _name += 138 | '' + 141 | d.component + 142 | ''; 143 | if (d.outlet) { 144 | _name += '<outlet> : ' + d.outlet + ''; 145 | } 146 | } else { 147 | _name += '/' + d.path + ''; 148 | if (d.component) { 149 | _name += 150 | '' + 153 | d.component + 154 | ''; 155 | } 156 | if (d.loadChildren) { 157 | var moduleName = foundLazyModuleWithPath(d.loadChildren); 158 | _name += 159 | '' + 162 | moduleName + 163 | ''; 164 | } 165 | if (d.canActivate) { 166 | _name += '✓ canActivate'; 167 | } 168 | if (d.canDeactivate) { 169 | _name += '×  canDeactivate'; 170 | } 171 | if (d.canActivateChild) { 172 | _name += '✓ canActivateChild'; 173 | } 174 | if (d.canLoad) { 175 | _name += '→ canLoad'; 176 | } 177 | if (d.redirectTo) { 178 | _name += '→ ' + d.redirectTo + ''; 179 | } 180 | if (d.pathMatch) { 181 | _name += '> ' + d.pathMatch + ''; 182 | } 183 | if (d.outlet) { 184 | _name += '<outlet> : ' + d.outlet + ''; 185 | } 186 | } 187 | return _name; 188 | }) 189 | .call(getBB); 190 | 191 | // 192 | // Node lazy loaded ? 193 | // 194 | infos_group 195 | .append('svg:text') 196 | .attr('y', function (d) { 197 | return 45; 198 | }) 199 | .attr('x', function (d) { 200 | return -18; 201 | }) 202 | .attr('font-family', 'Ionicons') 203 | .attr('class', function (d) { 204 | return 'icon'; 205 | }) 206 | .attr('font-size', function (d) { 207 | return '15px'; 208 | }) 209 | .text(function (d) { 210 | var _text = ''; 211 | if (d.loadChildren || d.loadComponent) { 212 | _text = '\uf4c1'; 213 | } 214 | if (d.guarded) { 215 | _text = '\uf1b0'; 216 | } 217 | return _text; 218 | }); 219 | 220 | //Node text background 221 | infos_group 222 | .insert('rect', 'text') 223 | .attr('width', function (d) { 224 | return d.bbox.width; 225 | }) 226 | .attr('height', function (d) { 227 | return d.bbox.height; 228 | }) 229 | .attr('y', function (d) { 230 | return 15; 231 | }) 232 | .style('fill', 'white') 233 | .style('fill-opacity', 0.75); 234 | 235 | nodes = engine.nodes(tree); 236 | 237 | function node_extents(n) { 238 | return [n.x - n.x_size / 2, n.y, n.x + n.x_size / 2, n.y + n.y_size]; 239 | } 240 | var root_extents = node_extents(nodes[0]); 241 | var xmin = root_extents[0], 242 | ymin = root_extents[1], 243 | xmax = root_extents[2], 244 | ymax = root_extents[3], 245 | area_sum = (xmax - xmin) * (ymax - ymin), 246 | x_size_min = nodes[0].x_size, 247 | y_size_min = nodes[0].y_size; 248 | 249 | nodes.slice(1).forEach(function (n) { 250 | var ne = node_extents(n); 251 | xmin = Math.min(xmin, ne[0]); 252 | ymin = Math.min(ymin, ne[1]); 253 | xmax = Math.max(xmax, ne[2]); 254 | ymax = Math.max(ymax, ne[3]); 255 | area_sum += (ne[2] - ne[0]) * (ne[3] - ne[1]); 256 | x_size_min = Math.min(x_size_min, n.x_size); 257 | y_size_min = Math.min(y_size_min, n.y_size); 258 | }); 259 | 260 | var area_ave = area_sum / nodes.length; 261 | var scale = 80 / Math.sqrt(area_ave); 262 | 263 | function svg_x(node_y) { 264 | return node_y - ymin; 265 | } 266 | 267 | function svg_y(node_x) { 268 | return (node_x - xmin) * scale; 269 | } 270 | 271 | var nodebox_right_margin = Math.min(x_size_min * scale, 10); 272 | var nodebox_vertical_margin = Math.min(y_size_min * scale, 3); 273 | 274 | node.attr('transform', function (d) { 275 | return 'translate(' + svg_x(d.y) + ',' + svg_y(d.x) + ')'; 276 | }); 277 | 278 | var diagonal = d3.svg.diagonal().projection(function (d) { 279 | return [svg_x(d.y), svg_y(d.x)]; 280 | }); 281 | 282 | var links = engine.links(nodes); 283 | var links = svg_p 284 | .selectAll('.link') 285 | .data(links) 286 | .enter() 287 | .append('path') 288 | .attr('class', 'link') 289 | .attr('d', diagonal); 290 | 291 | var _svg = document.getElementById('main'), 292 | main_g = _svg.childNodes[0]; 293 | 294 | _svg.removeChild(main_g); 295 | _svg.appendChild(main_g); 296 | 297 | svg.attr({ 298 | width: document.getElementById('main-group').getBBox()['width'] + 30, 299 | height: document.getElementById('main-group').getBBox()['height'] + 50 300 | }); 301 | }); 302 | -------------------------------------------------------------------------------- /docs/js/search/search-lunr.js: -------------------------------------------------------------------------------- 1 | (function (compodoc) { 2 | function LunrSearchEngine() { 3 | this.index = undefined; 4 | this.store = {}; 5 | this.name = 'LunrSearchEngine'; 6 | } 7 | 8 | LunrSearchEngine.prototype.init = function () { 9 | var that = this, 10 | d = new promise.Promise(); 11 | 12 | that.index = lunr.Index.load(COMPODOC_SEARCH_INDEX.index); 13 | that.store = COMPODOC_SEARCH_INDEX.store; 14 | d.done(); 15 | 16 | return d; 17 | }; 18 | 19 | LunrSearchEngine.prototype.search = function (q, offset, length) { 20 | var that = this, 21 | results = [], 22 | d = new promise.Promise(); 23 | 24 | if (this.index) { 25 | results = this.index.search('*' + q + '*').map(function (result) { 26 | var doc = that.store[result.ref]; 27 | 28 | return { 29 | title: doc.title, 30 | url: doc.url, 31 | body: doc.summary || doc.body 32 | }; 33 | }); 34 | } 35 | 36 | d.done({ 37 | query: q, 38 | results: length === 0 ? results : results.slice(0, length), 39 | count: results.length 40 | }); 41 | 42 | return d; 43 | }; 44 | 45 | compodoc.addEventListener(compodoc.EVENTS.READY, function (event) { 46 | var engine = new LunrSearchEngine(), 47 | initialized = false; 48 | 49 | function query(q, offset, length) { 50 | if (!initialized) throw new Error('Search has not been initialized'); 51 | return engine.search(q, offset, length); 52 | } 53 | 54 | compodoc.search = { 55 | query: query 56 | }; 57 | 58 | engine.init().then(function () { 59 | initialized = true; 60 | compodoc.dispatchEvent({ 61 | type: compodoc.EVENTS.SEARCH_READY 62 | }); 63 | }); 64 | }); 65 | })(compodoc); 66 | -------------------------------------------------------------------------------- /docs/js/search/search.js: -------------------------------------------------------------------------------- 1 | (function (compodoc) { 2 | var usePushState = typeof history.pushState !== 'undefined', 3 | // DOM Elements 4 | $body = document.querySelector('body'), 5 | $searchResults, 6 | $searchInput, 7 | $searchList, 8 | $searchTitle, 9 | $searchResultsCount, 10 | $searchQuery, 11 | $mainContainer, 12 | $xsMenu; 13 | 14 | // Throttle search 15 | function throttle(fn, wait) { 16 | var timeout; 17 | 18 | return function () { 19 | var ctx = this, 20 | args = arguments; 21 | if (!timeout) { 22 | timeout = setTimeout(function () { 23 | timeout = undefined; 24 | fn.apply(ctx, args); 25 | }, wait); 26 | } 27 | }; 28 | } 29 | 30 | function displayResults(res) { 31 | var noResults = res.count == 0; 32 | var groups = {}; 33 | if (noResults) { 34 | $searchResults.classList.add('no-results'); 35 | } else { 36 | $searchResults.classList.remove('no-results'); 37 | } 38 | 39 | // Clear old results 40 | $searchList.innerText = ''; 41 | 42 | // Display title for research 43 | $searchResultsCount.innerText = res.count; 44 | $searchQuery.innerText = res.query; 45 | 46 | // Group result by context 47 | res.results.forEach(function (res) { 48 | var context = res.title.split(' - ')[0]; 49 | if (typeof groups[context] === 'undefined') { 50 | groups[context] = { 51 | results: [res] 52 | }; 53 | } else { 54 | groups[context].results.push(res); 55 | } 56 | }); 57 | 58 | var sortedGroups = Object.keys(groups).sort(); 59 | 60 | for (var i = 0; i < sortedGroups.length; i++) { 61 | var property = sortedGroups[i]; 62 | 63 | var $li = document.createElement('li'); 64 | $li.classList.add('search-results-group'); 65 | var finalPropertyLabel = ''; 66 | var propertyLabels = property.split('-'); 67 | 68 | if ( 69 | propertyLabels.length === 2 && 70 | propertyLabels[0] !== 'miscellaneous' && 71 | propertyLabels[0] !== 'additional' 72 | ) { 73 | finalPropertyLabel = 74 | propertyLabels[0].charAt(0).toUpperCase() + 75 | propertyLabels[0].substring(1) + 76 | ' - ' + 77 | propertyLabels[1].charAt(0).toUpperCase() + 78 | propertyLabels[1].substring(1) + 79 | ' (' + 80 | groups[property].results.length + 81 | ')'; 82 | } else if (propertyLabels[0] === 'additional') { 83 | finalPropertyLabel = 84 | 'Additional pages' + ' (' + groups[property].results.length + ')'; 85 | } else { 86 | finalPropertyLabel = 87 | propertyLabels[0].charAt(0).toUpperCase() + 88 | propertyLabels[0].substring(1) + 89 | ' (' + 90 | groups[property].results.length + 91 | ')'; 92 | } 93 | var $groupTitle = document.createElement('h3'); 94 | $groupTitle.innerText = finalPropertyLabel; 95 | $li.appendChild($groupTitle); 96 | 97 | var $ulResults = document.createElement('ul'); 98 | $ulResults.classList.add('search-results-list'); 99 | 100 | groups[property].results.forEach(function (res) { 101 | var link = ''; 102 | var $liResult = document.createElement('li'); 103 | $liResult.classList.add('search-results-item'); 104 | switch (COMPODOC_CURRENT_PAGE_DEPTH) { 105 | case 0: 106 | link = './'; 107 | break; 108 | case 1: 109 | case 2: 110 | case 3: 111 | case 4: 112 | case 5: 113 | link = '../'.repeat(COMPODOC_CURRENT_PAGE_DEPTH); 114 | break; 115 | } 116 | var finalResLabel = 117 | res.title.split(' - ')[1].charAt(0).toUpperCase() + 118 | res.title.split(' - ')[1].substring(1); 119 | var $link = document.createElement('a'); 120 | $link.innerText = finalResLabel; 121 | $link.href = link + res.url; 122 | $liResult.appendChild($link); 123 | $ulResults.appendChild($liResult); 124 | }); 125 | $li.appendChild($ulResults); 126 | 127 | $searchList.appendChild($li); 128 | } 129 | } 130 | 131 | function launchSearch(q) { 132 | $body.classList.add('with-search'); 133 | 134 | if ($xsMenu.style.display === 'block') { 135 | $mainContainer.style.height = 'calc(100% - 100px)'; 136 | $mainContainer.style.marginTop = '100px'; 137 | } 138 | 139 | throttle( 140 | compodoc.search.query(q, 0, MAX_SEARCH_RESULTS).then(function (results) { 141 | displayResults(results); 142 | }), 143 | 1000 144 | ); 145 | } 146 | 147 | function closeSearch() { 148 | $body.classList.remove('with-search'); 149 | if ($xsMenu.style.display === 'block') { 150 | $mainContainer.style.height = 'calc(100% - 50px)'; 151 | } 152 | } 153 | 154 | function bindMenuButton() { 155 | document.getElementById('btn-menu').addEventListener('click', function () { 156 | if ($xsMenu.style.display === 'none') { 157 | $body.classList.remove('with-search'); 158 | $mainContainer.style.height = 'calc(100% - 50px)'; 159 | } 160 | $searchInputs.forEach((item, index) => { 161 | item.value = ''; 162 | }); 163 | }); 164 | } 165 | 166 | function bindSearch() { 167 | // Bind DOM 168 | $searchInputs = document.querySelectorAll('#book-search-input input'); 169 | 170 | $searchResults = document.querySelector('.search-results'); 171 | $searchList = $searchResults.querySelector('.search-results-list'); 172 | $searchTitle = $searchResults.querySelector('.search-results-title'); 173 | $searchResultsCount = $searchTitle.querySelector('.search-results-count'); 174 | $searchQuery = $searchTitle.querySelector('.search-query'); 175 | $mainContainer = document.querySelector('.container-fluid'); 176 | $xsMenu = document.querySelector('.xs-menu'); 177 | 178 | // Launch query based on input content 179 | function handleUpdate(item) { 180 | var q = item.value; 181 | 182 | if (q.length == 0) { 183 | closeSearch(); 184 | window.location.href = window.location.href.replace(window.location.search, ''); 185 | } else { 186 | launchSearch(q); 187 | } 188 | } 189 | 190 | // Detect true content change in search input 191 | var propertyChangeUnbound = false; 192 | 193 | $searchInputs.forEach((item, index) => { 194 | // HTML5 (IE9 & others) 195 | item.addEventListener('input', function (e) { 196 | handleUpdate(this); 197 | }); 198 | // Workaround for IE < 9 199 | item.addEventListener('propertychange', function (e) { 200 | if (e.originalEvent.propertyName == 'value') { 201 | handleUpdate(this); 202 | } 203 | }); 204 | // Push to history on blur 205 | item.addEventListener('blur', function (e) { 206 | // Update history state 207 | if (usePushState) { 208 | var uri = updateQueryString('q', this.value); 209 | if (this.value !== '') { 210 | history.pushState({ path: uri }, null, uri); 211 | } 212 | } 213 | }); 214 | }); 215 | } 216 | 217 | function launchSearchFromQueryString() { 218 | var q = getParameterByName('q'); 219 | if (q && q.length > 0) { 220 | // Update search inputs 221 | $searchInputs.forEach((item, index) => { 222 | item.value = q; 223 | }); 224 | // Launch search 225 | launchSearch(q); 226 | } 227 | } 228 | 229 | compodoc.addEventListener(compodoc.EVENTS.SEARCH_READY, function (event) { 230 | bindSearch(); 231 | 232 | bindMenuButton(); 233 | 234 | launchSearchFromQueryString(); 235 | }); 236 | 237 | function getParameterByName(name) { 238 | var url = window.location.href; 239 | name = name.replace(/[\[\]]/g, '\\$&'); 240 | var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'), 241 | results = regex.exec(url); 242 | if (!results) return null; 243 | if (!results[2]) return ''; 244 | return decodeURIComponent(results[2].replace(/\+/g, ' ')); 245 | } 246 | 247 | function updateQueryString(key, value) { 248 | value = encodeURIComponent(value); 249 | 250 | var url = window.location.href; 251 | var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'), 252 | hash; 253 | 254 | if (re.test(url)) { 255 | if (typeof value !== 'undefined' && value !== null) 256 | return url.replace(re, '$1' + key + '=' + value + '$2$3'); 257 | else { 258 | hash = url.split('#'); 259 | url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); 260 | if (typeof hash[1] !== 'undefined' && hash[1] !== null) url += '#' + hash[1]; 261 | return url; 262 | } 263 | } else { 264 | if (typeof value !== 'undefined' && value !== null) { 265 | var separator = url.indexOf('?') !== -1 ? '&' : '?'; 266 | hash = url.split('#'); 267 | url = hash[0] + separator + key + '=' + value; 268 | if (typeof hash[1] !== 'undefined' && hash[1] !== null) url += '#' + hash[1]; 269 | return url; 270 | } else return url; 271 | } 272 | } 273 | })(compodoc); 274 | -------------------------------------------------------------------------------- /docs/js/sourceCode.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | var $tabSource = document.querySelector('#source-tab'), 3 | $tabInfo = document.querySelector('#info-tab'), 4 | $tabReadme = document.querySelector('#readme-tab'), 5 | $tabTemplate = document.querySelector('#templateData-tab'), 6 | $tabTree = document.querySelector('#tree-tab'), 7 | $tabExample = document.querySelector('#example-tab'), 8 | $prismPre = document.querySelector('pre.compodoc-sourcecode'); 9 | if ($tabSource && $prismPre) { 10 | $prismCode = $prismPre.querySelector('code'), 11 | $content = document.querySelector('.content'), 12 | prismLinks = document.querySelectorAll('.link-to-prism') 13 | 14 | for (var i = 0; i < prismLinks.length; i++) { 15 | prismLinks[i].addEventListener('click', linkToPrism, false); 16 | } 17 | 18 | function linkToPrism(event) { 19 | var targetLine = event.target.getAttribute('data-line'); 20 | event.preventDefault(); 21 | 22 | $prismPre.setAttribute('data-line', targetLine); 23 | Prism.highlightElement($prismCode, function() {}); 24 | 25 | $tabSource.click(); 26 | 27 | setTimeout(function() { 28 | var $prismHighlightLine = document.querySelector('.line-highlight'), 29 | top = parseInt(getComputedStyle($prismHighlightLine)['top']); 30 | $content.scrollTop = top; 31 | }, 500); 32 | }; 33 | 34 | window.onhashchange = function(event) { 35 | switch (window.location.hash) { 36 | case '': 37 | case '#info': 38 | $tabInfo.click(); 39 | break; 40 | case '#readme': 41 | $tabReadme.click(); 42 | break; 43 | case '#source': 44 | $tabSource.click(); 45 | break; 46 | case '#template': 47 | $tabTemplate.click(); 48 | break; 49 | case '#dom-tree': 50 | $tabTree.click(); 51 | break; 52 | case '#example': 53 | $tabExample.click(); 54 | break; 55 | } 56 | } 57 | } 58 | }); 59 | -------------------------------------------------------------------------------- /docs/js/svg-pan-zoom.controls.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | if (document.getElementById('module-graph-svg')) { 3 | panZoom = svgPanZoom(document.getElementById('module-graph-svg').querySelector('svg'), { 4 | zoomEnabled: true, 5 | minZoom: 1, 6 | maxZoom: 5 7 | }); 8 | 9 | document.getElementById('zoom-in').addEventListener('click', function(ev) { 10 | ev.preventDefault(); 11 | panZoom.zoomIn(); 12 | }); 13 | 14 | document.getElementById('zoom-out').addEventListener('click', function(ev) { 15 | ev.preventDefault(); 16 | panZoom.zoomOut(); 17 | }); 18 | 19 | document.getElementById('reset').addEventListener('click', function(ev) { 20 | ev.preventDefault(); 21 | panZoom.resetZoom(); 22 | panZoom.resetPan(); 23 | }); 24 | 25 | var overviewFullscreen = false, 26 | originalOverviewHeight; 27 | 28 | document.getElementById('fullscreen').addEventListener('click', function(ev) { 29 | if (overviewFullscreen) { 30 | document.getElementById('module-graph-svg').style.height = originalOverviewHeight; 31 | overviewFullscreen = false; 32 | if (ev.target) { 33 | ev.target.classList.remove('ion-md-close'); 34 | ev.target.classList.add('ion-ios-resize'); 35 | } 36 | } else { 37 | originalOverviewHeight = document.getElementById('module-graph-svg').style.height; 38 | document.getElementById('module-graph-svg').style.height = '85vh'; 39 | overviewFullscreen = true; 40 | if (ev.target) { 41 | ev.target.classList.remove('ion-ios-resize'); 42 | ev.target.classList.add('ion-md-close'); 43 | } 44 | } 45 | document.getElementById('module-graph-svg').querySelector('svg').style.height = document.getElementById('module-graph-svg').clientHeight; 46 | setTimeout(function() { 47 | panZoom.resize(); 48 | panZoom.fit(); 49 | panZoom.center(); 50 | }, 0) 51 | }); 52 | } 53 | }); 54 | -------------------------------------------------------------------------------- /docs/js/tabs.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | var tabs = document.getElementsByClassName('nav-tabs'), 3 | updateAddress = function(e) { 4 | if(history.pushState && e.target.dataset.link) { 5 | history.pushState(null, null, '#' + e.target.dataset.link); 6 | } 7 | }; 8 | if (tabs.length > 0) { 9 | tabs = tabs[0].querySelectorAll('li'); 10 | for (var i = 0; i < tabs.length; i++) { 11 | tabs[i].addEventListener('click', updateAddress); 12 | var linkTag = tabs[i].querySelector('a'); 13 | if (location.hash !== '') { 14 | var currentHash = location.hash.substr(1); 15 | if (currentHash === linkTag.dataset.link) { 16 | linkTag.click(); 17 | } 18 | } 19 | } 20 | } 21 | }); 22 | -------------------------------------------------------------------------------- /docs/js/tree.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | var tabs = document.getElementsByClassName('nav-tabs')[0], 3 | tabsCollection = tabs.getElementsByTagName('A'), 4 | treeTab; 5 | var len = tabsCollection.length; 6 | for(var i = 0; i < len; i++) { 7 | if (tabsCollection[i].getAttribute('id') === 'tree-tab') { 8 | treeTab = tabsCollection[i]; 9 | } 10 | } 11 | 12 | // short-circuit if no tree tab 13 | if (!treeTab) return; 14 | 15 | var handler = new Tautologistics.NodeHtmlParser.HtmlBuilder(function(error, dom) { 16 | if (error) { 17 | console.log('handler ko'); 18 | } 19 | }), 20 | parser = new Tautologistics.NodeHtmlParser.Parser(handler), 21 | currentLocation = window.location; 22 | parser.parseComplete(COMPONENT_TEMPLATE); 23 | 24 | var newNodes = [], 25 | newEdges = [], 26 | parsedHtml = handler.dom[0], 27 | nodeCount = 0, 28 | nodeLevel = 0; 29 | 30 | newNodes.push({ 31 | _id: 0, 32 | label: parsedHtml.name, 33 | type: parsedHtml.type 34 | }) 35 | //Add id for nodes 36 | var traverseIds = function(o) { 37 | for (i in o) { 38 | if (!!o[i] && typeof(o[i]) == "object") { 39 | if (!o[i].length && o[i].type === 'tag') { 40 | nodeCount += 1; 41 | o[i]._id = nodeCount; 42 | } 43 | traverseIds(o[i]); 44 | } 45 | } 46 | } 47 | parsedHtml._id = 0; 48 | traverseIds(parsedHtml); 49 | 50 | 51 | var DeepIterator = deepIterator.default, 52 | it = DeepIterator(parsedHtml); 53 | for (let { 54 | value, 55 | parent, 56 | parentNode, 57 | key, 58 | type 59 | } of it) { 60 | if (type === 'NonIterableObject' && typeof key !== 'undefined' && value.type === 'tag') { 61 | var newNode = { 62 | id: value._id, 63 | label: value.name, 64 | type: value.type 65 | }; 66 | for(var i = 0; i < COMPONENTS.length; i++) { 67 | if (COMPONENTS[i].selector === value.name) { 68 | newNode.font = { 69 | multi: 'html' 70 | }; 71 | newNode.label = '' + newNode.label + ''; 72 | newNode.color = '#FB7E81'; 73 | newNode.name = COMPONENTS[i].name; 74 | } 75 | } 76 | for(var i = 0; i < DIRECTIVES.length; i++) { 77 | if (value.attributes) { 78 | for(attr in value.attributes) { 79 | if (DIRECTIVES[i].selector.indexOf(attr) !== -1) { 80 | newNode.font = { 81 | multi: 'html' 82 | }; 83 | newNode.label = '' + newNode.label + ''; 84 | newNode.color = '#FF9800'; 85 | newNode.name = DIRECTIVES[i].name; 86 | } 87 | } 88 | } 89 | } 90 | newNodes.push(newNode); 91 | newEdges.push({ 92 | from: parentNode._parent._id, 93 | to: value._id, 94 | arrows: 'to' 95 | }); 96 | } 97 | } 98 | 99 | newNodes.shift(); 100 | 101 | var container = document.getElementById('tree-container'), 102 | data = { 103 | nodes: newNodes, 104 | edges: newEdges 105 | }, 106 | options = { 107 | layout: { 108 | hierarchical: { 109 | sortMethod: 'directed', 110 | enabled: true 111 | } 112 | }, 113 | nodes: { 114 | shape: 'ellipse', 115 | fixed: true 116 | } 117 | }, 118 | 119 | handleClickNode = function(params) { 120 | var clickeNodeId; 121 | if (params.nodes.length > 0) { 122 | clickeNodeId = params.nodes[0]; 123 | for(var i = 0; i < newNodes.length; i++) { 124 | if (newNodes[i].id === clickeNodeId) { 125 | for(var j = 0; j < COMPONENTS.length; j++) { 126 | if (COMPONENTS[j].name === newNodes[i].name) { 127 | document.location.href = currentLocation.origin + currentLocation.pathname.replace(ACTUAL_COMPONENT.name, newNodes[i].name); 128 | } 129 | } 130 | } 131 | } 132 | } 133 | }, 134 | 135 | loadTree = function () { 136 | setTimeout(function() { 137 | container.style.height = document.getElementsByClassName('content')[0].offsetHeight - 140 + 'px'; 138 | var network = new vis.Network(container, data, options); 139 | network.on('click', handleClickNode); 140 | }, 200); // Fade is 0.150 141 | }; 142 | 143 | loadTree(); 144 | treeTab.addEventListener('click', function() { 145 | loadTree(); 146 | }); 147 | }); 148 | -------------------------------------------------------------------------------- /docs/license.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
      77 |
      78 | 81 | 82 |
      83 |
      84 | 85 |

      The MIT License (MIT)

      86 |

      Copyright (c) 2017 OpenDecide

      87 |

      Permission is hereby granted, free of charge, to any person obtaining a copy 88 | of this software and associated documentation files (the "Software"), to deal 89 | in the Software without restriction, including without limitation the rights 90 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 91 | copies of the Software, and to permit persons to whom the Software is 92 | furnished to do so, subject to the following conditions:

      93 |

      The above copyright notice and this permission notice shall be included in all 94 | copies or substantial portions of the Software.

      95 |

      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 96 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 97 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 98 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 99 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 100 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 101 | SOFTWARE.

      102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 |
      124 |
      125 |

      results matching ""

      126 |
        127 |
        128 |
        129 |

        No results matching ""

        130 |
        131 |
        132 |
        133 | 134 |
        135 |
        136 | 137 | 145 | 146 | 152 | 153 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /docs/miscellaneous/functions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
        77 |
        78 | 81 | 82 |
        83 |
        84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 106 | 107 |
        108 |

        Index

        109 | 110 | 111 | 112 | 119 | 120 | 121 |
        113 | 118 |
        122 |
        123 | 124 |

        src/ngx-segment-analytics.module.ts

        125 |
        126 |

        127 | 128 | 129 | 136 | 137 | 138 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 179 | 180 | 181 |
        130 | 131 | 132 | getWindow 133 | 134 | 135 |
        139 | getWindow(platformId: any) 140 |
        148 |

        Window Provider for Angular AOT

        149 |
        150 | 151 |
        152 | Parameters : 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 168 | 169 | 172 | 173 | 174 | 175 | 176 |
        NameTypeOptional
        platformId 166 | any 167 | 170 | No 171 |
        177 |
        178 |
        182 |
        183 | 184 | 185 |
        186 |
        187 |

        results matching ""

        188 |
          189 |
          190 |
          191 |

          No results matching ""

          192 |
          193 |
          194 |
          195 | 196 |
          197 |
          198 | 199 | 207 | 208 | 214 | 215 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | -------------------------------------------------------------------------------- /docs/miscellaneous/typealiases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
          77 |
          78 | 81 | 82 |
          83 |
          84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 106 | 107 |
          108 |

          Index

          109 | 110 | 111 | 112 | 125 | 126 | 127 |
          113 | 124 |
          128 |
          129 | 130 |

          src/ngx-segment-analytics.service.ts

          131 |
          132 | 133 | 134 | 135 | 139 | 140 | 141 | 145 | 146 | 147 |
          136 | 137 | DestinationMiddleware 138 |
          142 | function 143 | 144 |
          148 | 149 | 150 | 151 | 155 | 156 | 157 | 161 | 162 | 163 |
          152 | 153 | SegmentNextMiddleware 154 |
          158 | function 159 | 160 |
          164 | 165 | 166 | 167 | 171 | 172 | 173 | 177 | 178 | 179 |
          168 | 169 | SourceMiddleware 170 |
          174 | function 175 | 176 |
          180 |
          181 | 182 | 183 |
          184 |
          185 |

          results matching ""

          186 |
            187 |
            188 |
            189 |

            No results matching ""

            190 |
            191 |
            192 |
            193 | 194 |
            195 |
            196 | 197 | 205 | 206 | 212 | 213 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /docs/miscellaneous/variables.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
            77 |
            78 | 81 | 82 |
            83 |
            84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 106 | 107 |
            108 |

            Index

            109 | 110 | 111 | 112 | 122 | 123 | 124 |
            113 | 121 |
            125 |
            126 | 127 |

            src/ngx-segment-analytics.config.ts

            128 |
            129 |

            130 | 131 | 132 | 139 | 140 | 141 | 145 | 146 | 147 | 156 | 157 | 158 | 159 | 160 |
            133 | 134 | 135 | DEFAULT_CONFIG 136 | 137 | 138 |
            142 | Type : SegmentConfig 143 | 144 |
            148 | Default value : { 149 | debug: false, 150 | loadOnInitialization: true, // Compatibility < 1.2.5 151 | cdnURL: 'https://cdn.segment.com', 152 | segmentUri: '/analytics.js/v1/$API_KEY$/analytics.min.js', 153 | plugins: [], 154 | } 155 |
            161 | 162 | 163 | 164 | 171 | 172 | 173 | 177 | 178 | 179 | 182 | 183 | 184 | 185 | 189 | 190 | 191 | 192 |
            165 | 166 | 167 | SEGMENT_CONFIG 168 | 169 | 170 |
            174 | Type : InjectionToken<SegmentConfig> 175 | 176 |
            180 | Default value : new InjectionToken<SegmentConfig>('ngx-segment-analytics.config') 181 |
            186 |

            Segment Configuration Injection Token

            187 |
            188 |
            193 |
            194 | 195 | 196 | 197 |
            198 |
            199 |

            results matching ""

            200 |
              201 |
              202 |
              203 |

              No results matching ""

              204 |
              205 |
              206 |
              207 | 208 |
              209 |
              210 | 211 | 219 | 220 | 226 | 227 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | -------------------------------------------------------------------------------- /docs/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
              77 |
              78 | 81 | 82 |
              83 |
              84 | 85 | 86 | 87 | 90 |
              91 |
              92 |
              93 |
              94 |
              95 |

              SegmentModule

              96 |
              97 |
              98 |

              99 | No graph available. 100 |

              101 | 104 |
              105 |
              106 |
              107 |
              108 |
              109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
              128 |
              129 |

              results matching ""

              130 |
                131 |
                132 |
                133 |

                No results matching ""

                134 |
                135 |
                136 |
                137 | 138 |
                139 |
                140 | 141 | 149 | 150 | 156 | 157 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /docs/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
                77 |
                78 | 81 | 82 |
                83 |
                84 | 85 | 86 | 89 | 90 |
                91 |
                92 | 93 | 95 | 97 | 98 | 100 | 101 | dependencies 102 | 103 | Legend 104 | 105 |  Declarations 106 | 107 |  Module 108 | 109 |  Bootstrap 110 | 111 |  Providers 112 | 113 |  Exports 114 | 115 | 116 | 117 |
                118 | 119 |
                120 | 121 | 122 | 123 |
                124 |
                125 | 126 |
                127 |
                128 |
                129 |
                130 |
                131 |

                132 |

                133 | 1 Module 134 |

                135 |
                136 |
                137 |
                138 |
                139 |
                140 |
                141 |

                142 |

                2 Injectables

                143 |
                144 |
                145 |
                146 |
                147 |
                148 |
                149 |

                150 |

                2 Interfaces

                151 |
                152 |
                153 |
                154 |
                155 |
                156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 |
                177 |
                178 |

                results matching ""

                179 |
                  180 |
                  181 |
                  182 |

                  No results matching ""

                  183 |
                  184 |
                  185 |
                  186 | 187 |
                  188 |
                  189 | 190 | 198 | 199 | 205 | 206 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | -------------------------------------------------------------------------------- /docs/properties.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ngx-segment-analytics 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 64 | 65 | 71 | 72 | 75 | 76 |
                  77 |
                  78 | 81 | 82 |
                  83 |
                  84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 103 |
                    104 |
                  • 105 | Version : 19.0.0
                  • 106 |
                  • 107 | Keywords : angular, segment
                  • 108 |
                  • 109 | Bugs : https://github.com/opendecide/ngx-segment-analytics/issues
                  • 110 |
                  • 111 | License : MIT
                  • 112 |
                  • 113 | Repository : https://github.com/opendecide/ngx-segment-analytics
                  • 114 |
                  • 115 | Author : OpenDecide
                  • 116 |
                  117 | 118 | 119 | 120 | 121 | 122 |
                  123 |
                  124 |

                  results matching ""

                  125 |
                    126 |
                    127 |
                    128 |

                    No results matching ""

                    129 |
                    130 |
                    131 |
                    132 | 133 |
                    134 |
                    135 | 136 | 144 | 145 | 151 | 152 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /docs/styles/bootstrap-card.css: -------------------------------------------------------------------------------- 1 | .card { 2 | position: relative; 3 | display: block; 4 | margin-bottom: 20px; 5 | background-color: #fff; 6 | border: 1px solid #ddd; 7 | border-radius: 4px; 8 | } 9 | 10 | .card-block { 11 | padding: 15px; 12 | } 13 | .card-block:before, .card-block:after { 14 | content: " "; 15 | display: table; 16 | } 17 | .card-block:after { 18 | clear: both; 19 | } 20 | 21 | .card-title { 22 | margin: 5px; 23 | margin-bottom: 2px; 24 | text-align: center; 25 | } 26 | 27 | .card-subtitle { 28 | margin-top: -10px; 29 | margin-bottom: 0; 30 | } 31 | 32 | .card-text:last-child { 33 | margin-bottom: 0; 34 | margin-top: 10px; 35 | } 36 | 37 | .card-link:hover { 38 | text-decoration: none; 39 | } 40 | .card-link + .card-link { 41 | margin-left: 15px; 42 | } 43 | 44 | .card > .list-group:first-child .list-group-item:first-child { 45 | border-top-right-radius: 4px; 46 | border-top-left-radius: 4px; 47 | } 48 | .card > .list-group:last-child .list-group-item:last-child { 49 | border-bottom-right-radius: 4px; 50 | border-bottom-left-radius: 4px; 51 | } 52 | 53 | .card-header { 54 | padding: 10px 15px; 55 | background-color: #f5f5f5; 56 | border-bottom: 1px solid #ddd; 57 | } 58 | .card-header:before, .card-header:after { 59 | content: " "; 60 | display: table; 61 | } 62 | .card-header:after { 63 | clear: both; 64 | } 65 | .card-header:first-child { 66 | border-radius: 4px 4px 0 0; 67 | } 68 | 69 | .card-footer { 70 | padding: 10px 15px; 71 | background-color: #f5f5f5; 72 | border-top: 1px solid #ddd; 73 | } 74 | .card-footer:before, .card-footer:after { 75 | content: " "; 76 | display: table; 77 | } 78 | .card-footer:after { 79 | clear: both; 80 | } 81 | .card-footer:last-child { 82 | border-radius: 0 0 4px 4px; 83 | } 84 | 85 | .card-header-tabs { 86 | margin-right: -5px; 87 | margin-bottom: -10px; 88 | margin-left: -5px; 89 | border-bottom: 0; 90 | } 91 | 92 | .card-header-pills { 93 | margin-right: -5px; 94 | margin-left: -5px; 95 | } 96 | 97 | .card-primary { 98 | background-color: #337ab7; 99 | border-color: #337ab7; 100 | } 101 | .card-primary .card-header, 102 | .card-primary .card-footer { 103 | background-color: transparent; 104 | } 105 | 106 | .card-success { 107 | background-color: #5cb85c; 108 | border-color: #5cb85c; 109 | } 110 | .card-success .card-header, 111 | .card-success .card-footer { 112 | background-color: transparent; 113 | } 114 | 115 | .card-info { 116 | background-color: #5bc0de; 117 | border-color: #5bc0de; 118 | } 119 | .card-info .card-header, 120 | .card-info .card-footer { 121 | background-color: transparent; 122 | } 123 | 124 | .card-warning { 125 | background-color: #f0ad4e; 126 | border-color: #f0ad4e; 127 | } 128 | .card-warning .card-header, 129 | .card-warning .card-footer { 130 | background-color: transparent; 131 | } 132 | 133 | .card-danger { 134 | background-color: #d9534f; 135 | border-color: #d9534f; 136 | } 137 | .card-danger .card-header, 138 | .card-danger .card-footer { 139 | background-color: transparent; 140 | } 141 | 142 | .card-outline-primary { 143 | background-color: transparent; 144 | border-color: #337ab7; 145 | } 146 | 147 | .card-outline-secondary { 148 | background-color: transparent; 149 | border-color: #ccc; 150 | } 151 | 152 | .card-outline-info { 153 | background-color: transparent; 154 | border-color: #5bc0de; 155 | } 156 | 157 | .card-outline-success { 158 | background-color: transparent; 159 | border-color: #5cb85c; 160 | } 161 | 162 | .card-outline-warning { 163 | background-color: transparent; 164 | border-color: #f0ad4e; 165 | } 166 | 167 | .card-outline-danger { 168 | background-color: transparent; 169 | border-color: #d9534f; 170 | } 171 | 172 | .card-inverse .card-header, 173 | .card-inverse .card-footer { 174 | border-color: rgba(255, 255, 255, 0.2); 175 | } 176 | .card-inverse .card-header, 177 | .card-inverse .card-footer, 178 | .card-inverse .card-title, 179 | .card-inverse .card-blockquote { 180 | color: #fff; 181 | } 182 | .card-inverse .card-link, 183 | .card-inverse .card-text, 184 | .card-inverse .card-subtitle, 185 | .card-inverse .card-blockquote .blockquote-footer { 186 | color: rgba(255, 255, 255, 0.65); 187 | } 188 | .card-inverse .card-link:hover, .card-inverse .card-link:focus { 189 | color: #fff; 190 | } 191 | 192 | .card-blockquote { 193 | padding: 0; 194 | margin-bottom: 0; 195 | border-left: 0; 196 | } 197 | 198 | .card-img { 199 | border-radius: .25em; 200 | } 201 | 202 | .card-img-overlay { 203 | position: absolute; 204 | top: 0; 205 | right: 0; 206 | bottom: 0; 207 | left: 0; 208 | padding: 15px; 209 | } 210 | 211 | .card-img-top { 212 | border-top-right-radius: 4px; 213 | border-top-left-radius: 4px; 214 | } 215 | 216 | .card-img-bottom { 217 | border-bottom-right-radius: 4px; 218 | border-bottom-left-radius: 4px; 219 | } 220 | -------------------------------------------------------------------------------- /docs/styles/dark.css: -------------------------------------------------------------------------------- 1 | body.dark { 2 | background: #212121; 3 | color: #fafafa; 4 | } 5 | 6 | .dark code { 7 | color: #e09393; 8 | } 9 | 10 | .dark a, 11 | .dark .menu ul.list li a.active { 12 | color: #7fc9ff; 13 | } 14 | 15 | .dark .menu { 16 | background: #212121; 17 | border-right: 1px solid #444; 18 | } 19 | 20 | .dark .menu ul.list li a { 21 | color: #fafafa; 22 | } 23 | 24 | .dark .menu ul.list li.divider { 25 | background: #444; 26 | } 27 | 28 | .dark .xs-menu ul.list li:nth-child(2) { 29 | margin: 0; 30 | background: none; 31 | } 32 | 33 | .dark .menu ul.list li:nth-child(2) { 34 | margin: 0; 35 | background: none; 36 | } 37 | 38 | .dark #book-search-input { 39 | background: #212121; 40 | border-top: 1px solid #444; 41 | border-bottom: 1px solid #444; 42 | color: #fafafa; 43 | } 44 | 45 | .dark .table.metadata > tbody > tr:hover { 46 | color: #555; 47 | } 48 | 49 | .dark .table-bordered { 50 | border: 1px solid #444; 51 | } 52 | 53 | .dark .table-bordered > tbody > tr > td, 54 | .dark .table-bordered > tbody > tr > th, 55 | .dark .table-bordered > tfoot > tr > td, 56 | .dark .table-bordered > tfoot > tr > th, 57 | .dark .table-bordered > thead > tr > td, 58 | .dark .table-bordered > thead > tr > th { 59 | border: 1px solid #444; 60 | } 61 | 62 | .dark .coverage a, 63 | .dark .coverage-count { 64 | color: #fafafa; 65 | } 66 | 67 | .dark .coverage-header { 68 | color: black; 69 | } 70 | 71 | .dark .routes svg text, 72 | .dark .routes svg a { 73 | fill: white; 74 | } 75 | .dark .routes svg rect { 76 | fill: #212121 !important; 77 | } 78 | 79 | .dark .navbar-default, 80 | .dark .btn-default { 81 | background-color: black; 82 | border-color: #444; 83 | color: #fafafa; 84 | } 85 | 86 | .dark .navbar-default .navbar-brand { 87 | color: #fafafa; 88 | } 89 | 90 | .dark .overview .card, 91 | .dark .modules .card { 92 | background: #171717; 93 | color: #fafafa; 94 | border: 1px solid #444; 95 | } 96 | .dark .overview .card a { 97 | color: #fafafa; 98 | } 99 | 100 | .dark .modules .card-header { 101 | background: none; 102 | border-bottom: 1px solid #444; 103 | } 104 | 105 | .dark .module .list-group-item { 106 | background: none; 107 | border: 1px solid #444; 108 | } 109 | 110 | .dark .container-fluid.module h3 a { 111 | color: #337ab7; 112 | } 113 | 114 | .dark table.params thead { 115 | background: #484848; 116 | color: #fafafa; 117 | } 118 | 119 | .dark .content table { 120 | --bs-table-color: #fafafa; 121 | } 122 | -------------------------------------------------------------------------------- /docs/styles/laravel.css: -------------------------------------------------------------------------------- 1 | .nav-tabs > li > a { 2 | text-decoration: none; 3 | } 4 | 5 | .navbar-default .navbar-brand { 6 | color: #f4645f; 7 | text-decoration: none; 8 | font-size: 16px; 9 | } 10 | 11 | .menu ul.list li a[data-type='chapter-link'], 12 | .menu ul.list li.chapter .simple { 13 | color: #525252; 14 | border-bottom: 1px dashed rgba(0, 0, 0, 0.1); 15 | } 16 | 17 | .content h1, 18 | .content h2, 19 | .content h3, 20 | .content h4, 21 | .content h5 { 22 | color: #292e31; 23 | font-weight: normal; 24 | } 25 | 26 | .content { 27 | color: #4c555a; 28 | } 29 | 30 | a { 31 | color: #f4645f; 32 | text-decoration: underline; 33 | } 34 | a:hover { 35 | color: #f1362f; 36 | } 37 | 38 | .menu ul.list li:nth-child(2) { 39 | margin-top: 0; 40 | } 41 | 42 | .menu ul.list li.title a { 43 | color: #f4645f; 44 | text-decoration: none; 45 | font-size: 16px; 46 | } 47 | 48 | .menu ul.list li a { 49 | color: #f4645f; 50 | text-decoration: none; 51 | } 52 | .menu ul.list li a.active { 53 | color: #f4645f; 54 | font-weight: bold; 55 | } 56 | 57 | code { 58 | box-sizing: border-box; 59 | display: inline-block; 60 | padding: 0 5px; 61 | background: #f0f2f1; 62 | border-radius: 3px; 63 | color: #b93d6a; 64 | font-size: 13px; 65 | line-height: 20px; 66 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125); 67 | } 68 | 69 | pre { 70 | margin: 0; 71 | padding: 12px 12px; 72 | background: rgba(238, 238, 238, 0.35); 73 | border-radius: 3px; 74 | font-size: 13px; 75 | line-height: 1.5em; 76 | font-weight: 500; 77 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125); 78 | } 79 | 80 | .dark body { 81 | color: #fafafa; 82 | } 83 | .dark .content h1, 84 | .dark .content h2, 85 | .dark .content h3, 86 | .dark .content h4, 87 | .dark .content h5 { 88 | color: #fafafa; 89 | } 90 | 91 | .dark code { 92 | background: none; 93 | } 94 | 95 | .dark .content { 96 | color: #fafafa; 97 | } 98 | 99 | .dark .menu ul.list li a[data-type='chapter-link'], 100 | .dark .menu ul.list li.chapter .simple { 101 | color: #fafafa; 102 | } 103 | 104 | .dark .menu ul.list li.title a { 105 | color: #fafafa; 106 | } 107 | 108 | .dark .menu ul.list li a { 109 | color: #fafafa; 110 | } 111 | .dark .menu ul.list li a.active { 112 | color: #7fc9ff; 113 | } 114 | -------------------------------------------------------------------------------- /docs/styles/material.css: -------------------------------------------------------------------------------- 1 | .menu { 2 | background: none; 3 | } 4 | 5 | a:hover { 6 | text-decoration: none; 7 | } 8 | 9 | /** LINK **/ 10 | 11 | .menu ul.list li a { 12 | text-decoration: none; 13 | } 14 | 15 | .menu ul.list li a:hover, 16 | .menu ul.list li.chapter .simple:hover { 17 | background-color: #f8f9fa; 18 | text-decoration: none; 19 | } 20 | 21 | #book-search-input { 22 | margin-bottom: 0; 23 | } 24 | 25 | .menu ul.list li.divider { 26 | margin-top: 0; 27 | background: #e9ecef; 28 | } 29 | 30 | .menu .title:hover { 31 | background-color: #f8f9fa; 32 | } 33 | 34 | /** CARD **/ 35 | 36 | .card { 37 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 38 | 0 1px 5px 0 rgba(0, 0, 0, 0.12); 39 | border-radius: 0.125rem; 40 | border: 0; 41 | margin-top: 1px; 42 | } 43 | 44 | .card-header { 45 | background: none; 46 | } 47 | 48 | /** BUTTON **/ 49 | 50 | .btn { 51 | border-radius: 0.125rem; 52 | } 53 | 54 | /** NAV BAR **/ 55 | 56 | .nav { 57 | border: 0; 58 | } 59 | .nav-tabs > li > a { 60 | border: 0; 61 | border-bottom: 0.214rem solid transparent; 62 | color: rgba(0, 0, 0, 0.54); 63 | margin-right: 0; 64 | } 65 | .nav-tabs > li.active > a, 66 | .nav-tabs > li.active > a:focus, 67 | .nav-tabs > li.active > a:hover { 68 | color: rgba(0, 0, 0, 0.87); 69 | border-top: 0; 70 | border-left: 0; 71 | border-right: 0; 72 | border-bottom: 0.214rem solid transparent; 73 | border-color: #008cff; 74 | font-weight: bold; 75 | } 76 | .nav > li > a:focus, 77 | .nav > li > a:hover { 78 | background: none; 79 | } 80 | 81 | /** LIST **/ 82 | 83 | .list-group-item:first-child { 84 | border-top-left-radius: 0.125rem; 85 | border-top-right-radius: 0.125rem; 86 | } 87 | .list-group-item:last-child { 88 | border-bottom-left-radius: 0.125rem; 89 | border-bottom-right-radius: 0.125rem; 90 | } 91 | 92 | /** MISC **/ 93 | 94 | .modifier { 95 | border-radius: 0.125rem; 96 | } 97 | 98 | pre[class*='language-'] { 99 | border-radius: 0.125rem; 100 | } 101 | 102 | /** TABLE **/ 103 | 104 | .table-hover > tbody > tr:hover { 105 | background: rgba(0, 0, 0, 0.075); 106 | } 107 | 108 | table.params thead { 109 | background: none; 110 | } 111 | table.params thead td { 112 | color: rgba(0, 0, 0, 0.54); 113 | font-weight: bold; 114 | } 115 | 116 | .dark .menu .title:hover { 117 | background-color: #2d2d2d; 118 | } 119 | .dark .menu ul.list li a:hover, 120 | .dark .menu ul.list li.chapter .simple:hover { 121 | background-color: #2d2d2d; 122 | } 123 | .dark .nav-tabs > li:not(.active) > a { 124 | color: #fafafa; 125 | } 126 | .dark table.params thead { 127 | background: #484848; 128 | } 129 | .dark table.params thead td { 130 | color: #fafafa; 131 | } 132 | -------------------------------------------------------------------------------- /docs/styles/original.css: -------------------------------------------------------------------------------- 1 | .navbar-default .navbar-brand, 2 | .menu ul.list li.title { 3 | font-weight: bold; 4 | color: #3c3c3c; 5 | padding-bottom: 5px; 6 | } 7 | 8 | .menu ul.list li a[data-type='chapter-link'], 9 | .menu ul.list li.chapter .simple { 10 | font-weight: bold; 11 | font-size: 14px; 12 | } 13 | 14 | .menu ul.list li a[href='./routes.html'] { 15 | border-bottom: none; 16 | } 17 | 18 | .menu ul.list > li:nth-child(2) { 19 | display: none; 20 | } 21 | 22 | .menu ul.list li.chapter ul.links { 23 | background: #fff; 24 | padding-left: 0; 25 | } 26 | 27 | .menu ul.list li.chapter ul.links li { 28 | border-bottom: 1px solid #ddd; 29 | padding-left: 20px; 30 | } 31 | 32 | .menu ul.list li.chapter ul.links li:last-child { 33 | border-bottom: none; 34 | } 35 | 36 | .menu ul.list li a.active { 37 | color: #337ab7; 38 | font-weight: bold; 39 | } 40 | 41 | #book-search-input { 42 | margin-bottom: 0; 43 | border-bottom: none; 44 | } 45 | .menu ul.list li.divider { 46 | margin: 0; 47 | } 48 | 49 | .dark .menu ul.list li.chapter ul.links { 50 | background: none; 51 | } 52 | -------------------------------------------------------------------------------- /docs/styles/postmark.css: -------------------------------------------------------------------------------- 1 | .navbar-default { 2 | background: #ffde00; 3 | border: none; 4 | } 5 | 6 | .navbar-default .navbar-brand { 7 | color: #333; 8 | font-weight: bold; 9 | } 10 | 11 | .menu { 12 | background: #333; 13 | color: #fcfcfc; 14 | } 15 | 16 | .menu ul.list li a { 17 | color: #333; 18 | } 19 | 20 | .menu ul.list li.title { 21 | background: #ffde00; 22 | color: #333; 23 | padding-bottom: 5px; 24 | } 25 | 26 | .menu ul.list li:nth-child(2) { 27 | margin-top: 0; 28 | } 29 | 30 | .menu ul.list li.chapter a, 31 | .menu ul.list li.chapter .simple { 32 | color: white; 33 | text-decoration: none; 34 | } 35 | 36 | .menu ul.list li.chapter ul.links a { 37 | color: #949494; 38 | text-transform: none; 39 | padding-left: 35px; 40 | } 41 | 42 | .menu ul.list li.chapter ul.links a:hover, 43 | .menu ul.list li.chapter ul.links a.active { 44 | color: #ffde00; 45 | } 46 | 47 | .menu ul.list li.chapter ul.links { 48 | padding-left: 0; 49 | } 50 | 51 | .menu ul.list li.divider { 52 | background: rgba(255, 255, 255, 0.07); 53 | } 54 | 55 | #book-search-input input, 56 | #book-search-input input:focus, 57 | #book-search-input input:hover { 58 | color: #949494; 59 | } 60 | 61 | .copyright { 62 | color: #b3b3b3; 63 | background: #272525; 64 | } 65 | 66 | .content { 67 | background: #fcfcfc; 68 | } 69 | 70 | .content a { 71 | color: #007dcc; 72 | } 73 | 74 | .content a:visited { 75 | color: #0165a5; 76 | } 77 | 78 | .menu ul.list li:nth-last-child(2) { 79 | background: none; 80 | } 81 | 82 | .list-group-item:first-child, 83 | .list-group-item:last-child { 84 | border-radius: 0; 85 | } 86 | 87 | .menu ul.list li.title a { 88 | text-decoration: none; 89 | font-weight: bold; 90 | } 91 | 92 | .menu ul.list li.title a:hover { 93 | background: rgba(255, 255, 255, 0.1); 94 | } 95 | 96 | .breadcrumb > li + li:before { 97 | content: '»\00a0'; 98 | } 99 | 100 | .breadcrumb { 101 | padding-bottom: 15px; 102 | border-bottom: 1px solid #e1e4e5; 103 | } 104 | 105 | code { 106 | white-space: nowrap; 107 | max-width: 100%; 108 | background: #f5f5f5; 109 | padding: 2px 5px; 110 | color: #666666; 111 | overflow-x: auto; 112 | border-radius: 0; 113 | } 114 | 115 | pre { 116 | white-space: pre; 117 | margin: 0; 118 | padding: 12px 12px; 119 | font-size: 12px; 120 | line-height: 1.5; 121 | display: block; 122 | overflow: auto; 123 | color: #404040; 124 | background: #f3f3f3; 125 | } 126 | 127 | pre code.hljs { 128 | border: none; 129 | background: inherit; 130 | } 131 | 132 | /* 133 | Atom One Light by Daniel Gamage 134 | Original One Light Syntax theme from https://github.com/atom/one-light-syntax 135 | base: #fafafa 136 | mono-1: #383a42 137 | mono-2: #686b77 138 | mono-3: #a0a1a7 139 | hue-1: #0184bb 140 | hue-2: #4078f2 141 | hue-3: #a626a4 142 | hue-4: #50a14f 143 | hue-5: #e45649 144 | hue-5-2: #c91243 145 | hue-6: #986801 146 | hue-6-2: #c18401 147 | */ 148 | 149 | .hljs { 150 | display: block; 151 | overflow-x: auto; 152 | padding: 0.5em; 153 | color: #383a42; 154 | background: #fafafa; 155 | } 156 | 157 | .hljs-comment, 158 | .hljs-quote { 159 | color: #a0a1a7; 160 | font-style: italic; 161 | } 162 | 163 | .hljs-doctag, 164 | .hljs-keyword, 165 | .hljs-formula { 166 | color: #a626a4; 167 | } 168 | 169 | .hljs-section, 170 | .hljs-name, 171 | .hljs-selector-tag, 172 | .hljs-deletion, 173 | .hljs-subst { 174 | color: #e45649; 175 | } 176 | 177 | .hljs-literal { 178 | color: #0184bb; 179 | } 180 | 181 | .hljs-string, 182 | .hljs-regexp, 183 | .hljs-addition, 184 | .hljs-attribute, 185 | .hljs-meta-string { 186 | color: #50a14f; 187 | } 188 | 189 | .hljs-built_in, 190 | .hljs-class .hljs-title { 191 | color: #c18401; 192 | } 193 | 194 | .hljs-attr, 195 | .hljs-variable, 196 | .hljs-template-variable, 197 | .hljs-type, 198 | .hljs-selector-class, 199 | .hljs-selector-attr, 200 | .hljs-selector-pseudo, 201 | .hljs-number { 202 | color: #986801; 203 | } 204 | 205 | .hljs-symbol, 206 | .hljs-bullet, 207 | .hljs-link, 208 | .hljs-meta, 209 | .hljs-selector-id, 210 | .hljs-title { 211 | color: #4078f2; 212 | } 213 | 214 | .hljs-emphasis { 215 | font-style: italic; 216 | } 217 | 218 | .hljs-strong { 219 | font-weight: bold; 220 | } 221 | 222 | .hljs-link { 223 | text-decoration: underline; 224 | } 225 | 226 | .dark .content { 227 | background: none; 228 | } 229 | .dark code { 230 | background: none; 231 | color: #e09393; 232 | } 233 | .dark .menu ul.list li.chapter a.active { 234 | color: #ffde00; 235 | } 236 | .dark .menu { 237 | background: #272525; 238 | } 239 | -------------------------------------------------------------------------------- /docs/styles/prism.css: -------------------------------------------------------------------------------- 1 | /* PrismJS 1.24.0 2 | https://prismjs.com/download.html?#themes=prism-okaidia&languages=markup+css+clike+javascript+apacheconf+aspnet+bash+c+csharp+cpp+coffeescript+dart+docker+elm+git+go+graphql+handlebars+haskell+http+ignore+java+json+kotlin+less+markdown+markup-templating+nginx+php+powershell+ruby+rust+sass+scss+sql+swift+typescript+wasm+yaml&plugins=line-highlight+line-numbers+toolbar+copy-to-clipboard */ 3 | /** 4 | * okaidia theme for JavaScript, CSS and HTML 5 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 6 | * @author ocodia 7 | */ 8 | 9 | code[class*='language-'], 10 | pre[class*='language-'] { 11 | color: #f8f8f2; 12 | background: none; 13 | text-shadow: 0 1px rgba(0, 0, 0, 0.3); 14 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 15 | font-size: 1em; 16 | text-align: left; 17 | white-space: pre; 18 | word-spacing: normal; 19 | word-break: normal; 20 | word-wrap: normal; 21 | line-height: 1.5; 22 | 23 | -moz-tab-size: 4; 24 | -o-tab-size: 4; 25 | tab-size: 4; 26 | 27 | -webkit-hyphens: none; 28 | -moz-hyphens: none; 29 | -ms-hyphens: none; 30 | hyphens: none; 31 | } 32 | 33 | /* Code blocks */ 34 | pre[class*='language-'] { 35 | padding: 1em; 36 | margin: 0.5em 0; 37 | overflow: auto; 38 | border-radius: 0.3em; 39 | } 40 | 41 | :not(pre) > code[class*='language-'], 42 | pre[class*='language-'] { 43 | background: #272822; 44 | } 45 | 46 | /* Inline code */ 47 | :not(pre) > code[class*='language-'] { 48 | padding: 0.1em; 49 | border-radius: 0.3em; 50 | white-space: normal; 51 | } 52 | 53 | .token.comment, 54 | .token.prolog, 55 | .token.doctype, 56 | .token.cdata { 57 | color: #8292a2; 58 | } 59 | 60 | .token.punctuation { 61 | color: #f8f8f2; 62 | } 63 | 64 | .token.namespace { 65 | opacity: 0.7; 66 | } 67 | 68 | .token.property, 69 | .token.tag, 70 | .token.constant, 71 | .token.symbol, 72 | .token.deleted { 73 | color: #f92672; 74 | } 75 | 76 | .token.boolean, 77 | .token.number { 78 | color: #ae81ff; 79 | } 80 | 81 | .token.selector, 82 | .token.attr-name, 83 | .token.string, 84 | .token.char, 85 | .token.builtin, 86 | .token.inserted { 87 | color: #a6e22e; 88 | } 89 | 90 | .token.operator, 91 | .token.entity, 92 | .token.url, 93 | .language-css .token.string, 94 | .style .token.string, 95 | .token.variable { 96 | color: #f8f8f2; 97 | } 98 | 99 | .token.atrule, 100 | .token.attr-value, 101 | .token.function, 102 | .token.class-name { 103 | color: #e6db74; 104 | } 105 | 106 | .token.keyword { 107 | color: #66d9ef; 108 | } 109 | 110 | .token.regex, 111 | .token.important { 112 | color: #fd971f; 113 | } 114 | 115 | .token.important, 116 | .token.bold { 117 | font-weight: bold; 118 | } 119 | .token.italic { 120 | font-style: italic; 121 | } 122 | 123 | .token.entity { 124 | cursor: help; 125 | } 126 | 127 | pre[data-line] { 128 | position: relative; 129 | padding: 1em 0 1em 3em; 130 | } 131 | 132 | .line-highlight { 133 | position: absolute; 134 | left: 0; 135 | right: 0; 136 | padding: inherit 0; 137 | margin-top: 1em; /* Same as .prism’s padding-top */ 138 | 139 | background: hsla(24, 20%, 50%, 0.08); 140 | background: linear-gradient(to right, hsla(24, 20%, 50%, 0.1) 70%, hsla(24, 20%, 50%, 0)); 141 | 142 | pointer-events: none; 143 | 144 | line-height: inherit; 145 | white-space: pre; 146 | } 147 | 148 | @media print { 149 | .line-highlight { 150 | /* 151 | * This will prevent browsers from replacing the background color with white. 152 | * It's necessary because the element is layered on top of the displayed code. 153 | */ 154 | -webkit-print-color-adjust: exact; 155 | color-adjust: exact; 156 | } 157 | } 158 | 159 | .line-highlight:before, 160 | .line-highlight[data-end]:after { 161 | content: attr(data-start); 162 | position: absolute; 163 | top: 0.4em; 164 | left: 0.6em; 165 | min-width: 1em; 166 | padding: 0 0.5em; 167 | background-color: hsla(24, 20%, 50%, 0.4); 168 | color: hsl(24, 20%, 95%); 169 | font: bold 65%/1.5 sans-serif; 170 | text-align: center; 171 | vertical-align: 0.3em; 172 | border-radius: 999px; 173 | text-shadow: none; 174 | box-shadow: 0 1px white; 175 | } 176 | 177 | .line-highlight[data-end]:after { 178 | content: attr(data-end); 179 | top: auto; 180 | bottom: 0.4em; 181 | } 182 | 183 | .line-numbers .line-highlight:before, 184 | .line-numbers .line-highlight:after { 185 | content: none; 186 | } 187 | 188 | pre[id].linkable-line-numbers span.line-numbers-rows { 189 | pointer-events: all; 190 | } 191 | pre[id].linkable-line-numbers span.line-numbers-rows > span:before { 192 | cursor: pointer; 193 | } 194 | pre[id].linkable-line-numbers span.line-numbers-rows > span:hover:before { 195 | background-color: rgba(128, 128, 128, 0.2); 196 | } 197 | 198 | pre[class*='language-'].line-numbers { 199 | position: relative; 200 | padding-left: 3.8em; 201 | counter-reset: linenumber; 202 | } 203 | 204 | pre[class*='language-'].line-numbers > code { 205 | position: relative; 206 | white-space: inherit; 207 | } 208 | 209 | .line-numbers .line-numbers-rows { 210 | position: absolute; 211 | pointer-events: none; 212 | top: 0; 213 | font-size: 100%; 214 | left: -3.8em; 215 | width: 3em; /* works for line-numbers below 1000 lines */ 216 | letter-spacing: -1px; 217 | border-right: 1px solid #999; 218 | 219 | -webkit-user-select: none; 220 | -moz-user-select: none; 221 | -ms-user-select: none; 222 | user-select: none; 223 | } 224 | 225 | .line-numbers-rows > span { 226 | display: block; 227 | counter-increment: linenumber; 228 | } 229 | 230 | .line-numbers-rows > span:before { 231 | content: counter(linenumber); 232 | color: #999; 233 | display: block; 234 | padding-right: 0.8em; 235 | text-align: right; 236 | } 237 | 238 | div.code-toolbar { 239 | position: relative; 240 | } 241 | 242 | div.code-toolbar > .toolbar { 243 | position: absolute; 244 | top: 0.3em; 245 | right: 0.2em; 246 | transition: opacity 0.3s ease-in-out; 247 | opacity: 0; 248 | } 249 | 250 | div.code-toolbar:hover > .toolbar { 251 | opacity: 1; 252 | } 253 | 254 | /* Separate line b/c rules are thrown out if selector is invalid. 255 | IE11 and old Edge versions don't support :focus-within. */ 256 | div.code-toolbar:focus-within > .toolbar { 257 | opacity: 1; 258 | } 259 | 260 | div.code-toolbar > .toolbar .toolbar-item { 261 | display: inline-block; 262 | } 263 | 264 | div.code-toolbar > .toolbar a { 265 | cursor: pointer; 266 | } 267 | 268 | div.code-toolbar > .toolbar button { 269 | background: none; 270 | border: 0; 271 | color: inherit; 272 | font: inherit; 273 | line-height: normal; 274 | overflow: visible; 275 | padding: 0; 276 | -webkit-user-select: none; /* for button */ 277 | -moz-user-select: none; 278 | -ms-user-select: none; 279 | } 280 | 281 | div.code-toolbar > .toolbar a, 282 | div.code-toolbar > .toolbar button, 283 | div.code-toolbar > .toolbar span { 284 | color: #bbb; 285 | font-size: 0.8em; 286 | padding: 0 0.5em; 287 | background: #f5f2f0; 288 | background: rgba(224, 224, 224, 0.2); 289 | box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); 290 | border-radius: 0.5em; 291 | } 292 | 293 | div.code-toolbar > .toolbar a:hover, 294 | div.code-toolbar > .toolbar a:focus, 295 | div.code-toolbar > .toolbar button:hover, 296 | div.code-toolbar > .toolbar button:focus, 297 | div.code-toolbar > .toolbar span:hover, 298 | div.code-toolbar > .toolbar span:focus { 299 | color: inherit; 300 | text-decoration: none; 301 | } 302 | -------------------------------------------------------------------------------- /docs/styles/readthedocs.css: -------------------------------------------------------------------------------- 1 | .navbar-default { 2 | background: #2980b9; 3 | border: none; 4 | } 5 | 6 | .navbar-default .navbar-brand { 7 | color: #fcfcfc; 8 | } 9 | 10 | .menu { 11 | background: #343131; 12 | color: #fcfcfc; 13 | } 14 | 15 | .menu ul.list li a { 16 | color: #fcfcfc; 17 | } 18 | 19 | .menu ul.list li.title { 20 | background: #2980b9; 21 | padding-bottom: 5px; 22 | } 23 | 24 | .menu ul.list li:nth-child(2) { 25 | margin-top: 0; 26 | } 27 | 28 | .menu ul.list li.chapter a, 29 | .menu ul.list li.chapter .simple { 30 | color: #555; 31 | text-transform: uppercase; 32 | text-decoration: none; 33 | } 34 | 35 | .menu ul.list li.chapter ul.links a { 36 | color: #b3b3b3; 37 | text-transform: none; 38 | padding-left: 35px; 39 | } 40 | 41 | .menu ul.list li.chapter ul.links a:hover { 42 | background: #4e4a4a; 43 | } 44 | 45 | .menu ul.list li.chapter a.active, 46 | .menu ul.list li.chapter ul.links a.active { 47 | color: #0099e5; 48 | } 49 | 50 | .menu ul.list li.chapter ul.links { 51 | padding-left: 0; 52 | } 53 | 54 | .menu ul.list li.divider { 55 | background: rgba(255, 255, 255, 0.07); 56 | } 57 | 58 | #book-search-input input, 59 | #book-search-input input:focus, 60 | #book-search-input input:hover { 61 | color: #949494; 62 | } 63 | 64 | .copyright { 65 | color: #b3b3b3; 66 | background: #272525; 67 | } 68 | 69 | .content { 70 | background: #fcfcfc; 71 | } 72 | 73 | .content a { 74 | color: #2980b9; 75 | } 76 | 77 | .content a:hover { 78 | color: #3091d1; 79 | } 80 | 81 | .content a:visited { 82 | color: #9b59b6; 83 | } 84 | 85 | .menu ul.list li:nth-last-child(2) { 86 | background: none; 87 | } 88 | 89 | code { 90 | white-space: nowrap; 91 | max-width: 100%; 92 | background: #fff; 93 | padding: 2px 5px; 94 | color: #e74c3c; 95 | overflow-x: auto; 96 | border-radius: 0; 97 | } 98 | 99 | pre { 100 | white-space: pre; 101 | margin: 0; 102 | padding: 12px 12px; 103 | font-size: 12px; 104 | line-height: 1.5; 105 | display: block; 106 | overflow: auto; 107 | color: #404040; 108 | background: rgba(238, 238, 238, 0.35); 109 | } 110 | 111 | .dark .content { 112 | background: none; 113 | } 114 | .dark code { 115 | background: none; 116 | color: #e09393; 117 | } 118 | -------------------------------------------------------------------------------- /docs/styles/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, 7 | body, 8 | div, 9 | span, 10 | applet, 11 | object, 12 | iframe, 13 | h1, 14 | h2, 15 | h3, 16 | h4, 17 | h5, 18 | h6, 19 | p, 20 | blockquote, 21 | pre, 22 | a, 23 | abbr, 24 | acronym, 25 | address, 26 | big, 27 | cite, 28 | code, 29 | del, 30 | dfn, 31 | em, 32 | img, 33 | ins, 34 | kbd, 35 | q, 36 | s, 37 | samp, 38 | small, 39 | strike, 40 | strong, 41 | sub, 42 | sup, 43 | tt, 44 | var, 45 | b, 46 | u, 47 | i, 48 | center, 49 | dl, 50 | dt, 51 | dd, 52 | ol, 53 | ul, 54 | li, 55 | fieldset, 56 | form, 57 | label, 58 | legend, 59 | table, 60 | caption, 61 | tbody, 62 | tfoot, 63 | thead, 64 | tr, 65 | th, 66 | td, 67 | article, 68 | aside, 69 | canvas, 70 | details, 71 | embed, 72 | figure, 73 | figcaption, 74 | footer, 75 | header, 76 | hgroup, 77 | menu, 78 | nav, 79 | output, 80 | ruby, 81 | section, 82 | summary, 83 | time, 84 | mark, 85 | audio, 86 | video { 87 | margin: 0; 88 | padding: 0; 89 | border: 0; 90 | font: inherit; 91 | font-size: 100%; 92 | vertical-align: baseline; 93 | } 94 | /* HTML5 display-role reset for older browsers */ 95 | article, 96 | aside, 97 | details, 98 | figcaption, 99 | figure, 100 | footer, 101 | header, 102 | hgroup, 103 | menu, 104 | nav, 105 | section { 106 | display: block; 107 | } 108 | body { 109 | line-height: 1; 110 | } 111 | ol, 112 | ul { 113 | list-style: none; 114 | } 115 | blockquote, 116 | q { 117 | quotes: none; 118 | } 119 | blockquote:before, 120 | blockquote:after, 121 | q:before, 122 | q:after { 123 | content: ''; 124 | content: none; 125 | } 126 | table { 127 | border-collapse: collapse; 128 | border-spacing: 0; 129 | } 130 | -------------------------------------------------------------------------------- /docs/styles/stripe.css: -------------------------------------------------------------------------------- 1 | .navbar-default .navbar-brand { 2 | color: #0099e5; 3 | } 4 | 5 | .menu ul.list li a[data-type='chapter-link'], 6 | .menu ul.list li.chapter .simple { 7 | color: #939da3; 8 | text-transform: uppercase; 9 | } 10 | 11 | .content h1, 12 | .content h2, 13 | .content h3, 14 | .content h4, 15 | .content h5 { 16 | color: #292e31; 17 | font-weight: normal; 18 | } 19 | 20 | .content { 21 | color: #4c555a; 22 | } 23 | 24 | .menu ul.list li.title { 25 | padding: 5px 0; 26 | } 27 | 28 | a { 29 | color: #0099e5; 30 | text-decoration: none; 31 | } 32 | a:hover { 33 | color: #292e31; 34 | text-decoration: none; 35 | } 36 | 37 | .menu ul.list li:nth-child(2) { 38 | margin-top: 0; 39 | } 40 | 41 | .menu ul.list li.title a, 42 | .navbar a { 43 | color: #0099e5; 44 | text-decoration: none; 45 | font-size: 16px; 46 | } 47 | 48 | .menu ul.list li a.active { 49 | color: #0099e5; 50 | } 51 | 52 | code { 53 | box-sizing: border-box; 54 | display: inline-block; 55 | padding: 0 5px; 56 | background: #fafcfc; 57 | border-radius: 4px; 58 | color: #b93d6a; 59 | font-size: 13px; 60 | line-height: 20px; 61 | } 62 | 63 | pre { 64 | margin: 0; 65 | padding: 12px 12px; 66 | background: #272b2d; 67 | border-radius: 5px; 68 | font-size: 13px; 69 | line-height: 1.5em; 70 | font-weight: 500; 71 | } 72 | 73 | .dark body { 74 | color: #fafafa; 75 | } 76 | .dark .content h1, 77 | .dark .content h2, 78 | .dark .content h3, 79 | .dark .content h4, 80 | .dark .content h5 { 81 | color: #fafafa; 82 | } 83 | 84 | .dark code { 85 | background: none; 86 | } 87 | 88 | .dark .content { 89 | color: #fafafa; 90 | } 91 | 92 | .dark .menu ul.list li a[data-type='chapter-link'], 93 | .dark .menu ul.list li.chapter .simple { 94 | color: #fafafa; 95 | } 96 | 97 | .dark .menu ul.list li.title a { 98 | color: #fafafa; 99 | } 100 | 101 | .dark .menu ul.list li a { 102 | color: #fafafa; 103 | } 104 | .dark .menu ul.list li a.active { 105 | color: #7fc9ff; 106 | } 107 | -------------------------------------------------------------------------------- /docs/styles/style.css: -------------------------------------------------------------------------------- 1 | @import "./reset.css"; 2 | @import "./bootstrap.min.css"; 3 | @import "./bootstrap-card.css"; 4 | @import "./prism.css"; 5 | @import "./ionicons.min.css"; 6 | @import "./compodoc.css"; 7 | @import "./tablesort.css"; 8 | -------------------------------------------------------------------------------- /docs/styles/tablesort.css: -------------------------------------------------------------------------------- 1 | th[role=columnheader]:not(.no-sort) { 2 | cursor: pointer; 3 | } 4 | 5 | th[role=columnheader]:not(.no-sort):after { 6 | content: ''; 7 | float: right; 8 | margin-top: 7px; 9 | border-width: 0 4px 4px; 10 | border-style: solid; 11 | border-color: #404040 transparent; 12 | visibility: visible; 13 | opacity: 1; 14 | -ms-user-select: none; 15 | -webkit-user-select: none; 16 | -moz-user-select: none; 17 | user-select: none; 18 | } 19 | 20 | th[aria-sort=ascending]:not(.no-sort):after { 21 | border-bottom: none; 22 | border-width: 4px 4px 0; 23 | } 24 | 25 | th[aria-sort]:not(.no-sort):after { 26 | visibility: visible; 27 | opacity: 0.4; 28 | } 29 | 30 | th[role=columnheader]:not(.no-sort):hover:after { 31 | visibility: visible; 32 | opacity: 1; 33 | } 34 | -------------------------------------------------------------------------------- /docs/styles/vagrant.css: -------------------------------------------------------------------------------- 1 | .navbar-default .navbar-brand { 2 | background: white; 3 | color: #8d9ba8; 4 | } 5 | 6 | .menu .list { 7 | background: #0c5593; 8 | } 9 | 10 | .menu .chapter { 11 | padding: 0 20px; 12 | } 13 | 14 | .menu ul.list li a[data-type='chapter-link'], 15 | .menu ul.list li.chapter .simple { 16 | color: white; 17 | text-transform: uppercase; 18 | border-bottom: 1px solid rgba(255, 255, 255, 0.4); 19 | } 20 | 21 | .content h1, 22 | .content h2, 23 | .content h3, 24 | .content h4, 25 | .content h5 { 26 | color: #292e31; 27 | font-weight: normal; 28 | } 29 | 30 | .content { 31 | color: #4c555a; 32 | } 33 | 34 | a { 35 | color: #0094bf; 36 | text-decoration: underline; 37 | } 38 | a:hover { 39 | color: #f1362f; 40 | } 41 | 42 | .menu ul.list li.title { 43 | background: white; 44 | padding-bottom: 5px; 45 | } 46 | 47 | .menu ul.list li:nth-child(2) { 48 | margin-top: 0; 49 | } 50 | 51 | .menu ul.list li:nth-last-child(2) { 52 | background: none; 53 | } 54 | 55 | .menu ul.list li.title a { 56 | padding: 10px 15px; 57 | } 58 | 59 | .menu ul.list li.title a, 60 | .navbar a { 61 | color: #8d9ba8; 62 | text-decoration: none; 63 | font-size: 16px; 64 | font-weight: 300; 65 | } 66 | 67 | .menu ul.list li a { 68 | color: white; 69 | padding: 10px; 70 | font-weight: 300; 71 | text-decoration: none; 72 | } 73 | .menu ul.list li a.active { 74 | color: white; 75 | font-weight: bold; 76 | } 77 | 78 | .copyright { 79 | color: white; 80 | background: #000; 81 | } 82 | 83 | code { 84 | box-sizing: border-box; 85 | display: inline-block; 86 | padding: 0 5px; 87 | background: rgba(0, 148, 191, 0.1); 88 | border-radius: 3px; 89 | color: #0094bf; 90 | font-size: 13px; 91 | line-height: 20px; 92 | } 93 | 94 | pre { 95 | margin: 0; 96 | padding: 12px 12px; 97 | background: rgba(238, 238, 238, 0.35); 98 | border-radius: 3px; 99 | font-size: 13px; 100 | line-height: 1.5em; 101 | font-weight: 500; 102 | } 103 | 104 | .dark body { 105 | color: #fafafa; 106 | } 107 | .dark .content h1, 108 | .dark .content h2, 109 | .dark .content h3, 110 | .dark .content h4, 111 | .dark .content h5 { 112 | color: #fafafa; 113 | } 114 | 115 | .dark code { 116 | background: none; 117 | } 118 | 119 | .dark .content { 120 | color: #fafafa; 121 | } 122 | 123 | .dark .menu ul.list li.title a, 124 | .dark .navbar a { 125 | color: #8d9ba8; 126 | } 127 | 128 | .dark .menu ul.list li a { 129 | color: #fafafa; 130 | } 131 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import path from "node:path"; 2 | import {fileURLToPath} from "node:url"; 3 | import js from "@eslint/js"; 4 | import {FlatCompat} from "@eslint/eslintrc"; 5 | 6 | const __filename = fileURLToPath(import.meta.url); 7 | const __dirname = path.dirname(__filename); 8 | const compat = new FlatCompat({ 9 | baseDirectory: __dirname, 10 | recommendedConfig: js.configs.recommended, 11 | allConfig: js.configs.all 12 | }); 13 | 14 | export default [ 15 | ...compat.extends("plugin:@angular-eslint/recommended") 16 | .map(config => ({ 17 | ...config, 18 | files: ["src/**/*.ts"], 19 | })), 20 | { 21 | files: ["src/**/*.ts"], 22 | languageOptions: { 23 | ecmaVersion: 5, 24 | sourceType: "script", 25 | 26 | parserOptions: { 27 | project: ["tsconfig.*?.json"], 28 | createDefaultProgram: true, 29 | }, 30 | }, 31 | rules: { 32 | quotes: ["error", "single", { 33 | allowTemplateLiterals: true, 34 | }], 35 | }, 36 | }, 37 | ...compat.extends("plugin:@angular-eslint/template/recommended") 38 | .map(config => ({ 39 | ...config, 40 | files: ["src/**/*.component.html"], 41 | })), 42 | { 43 | files: ["src/**/*.component.html"], 44 | rules: { 45 | "max-len": ["error", { 46 | code: 140, 47 | }], 48 | }, 49 | }, 50 | ...compat.extends("plugin:@angular-eslint/template/process-inline-templates") 51 | .map(config => ({ 52 | ...config, 53 | files: ["src/**/*.component.ts"], 54 | })) 55 | ]; 56 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@opendecide/ngx-segment-analytics", 3 | "version": "19.0.1", 4 | "packageManager": "yarn@4.6.0", 5 | "scripts": { 6 | "build": "ng-packagr -p src/ng-package.json", 7 | "build:watch": "yarn run build --watch", 8 | "docs": "yarn run docs:build", 9 | "docs:build": "compodoc -p tsconfig.json -n ngx-segment-analytics -d docs --hideGenerator", 10 | "docs:serve": "yarn run docs:build -- -s", 11 | "docs:watch": "yarn run docs:build -- -s -w", 12 | "lint": "eslint", 13 | "test": "echo 'not implemented yet'", 14 | "test_not_yet": "tsc && karma start" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "https://github.com/opendecide/ngx-segment-analytics" 19 | }, 20 | "author": { 21 | "name": "OpenDecide" 22 | }, 23 | "keywords": [ 24 | "angular", 25 | "segment" 26 | ], 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/opendecide/ngx-segment-analytics/issues" 30 | }, 31 | "devDependencies": { 32 | "@angular-eslint/eslint-plugin": "^19.0.2", 33 | "@angular-eslint/eslint-plugin-template": "^19.0.2", 34 | "@angular-eslint/template-parser": "^19.0.2", 35 | "@angular/common": "^19.0.6", 36 | "@angular/compiler": "^19.0.6", 37 | "@angular/compiler-cli": "^19.0.6", 38 | "@angular/core": "^19.0.6", 39 | "@angular/platform-browser": "^19.0.6", 40 | "@angular/platform-browser-dynamic": "^19.0.6", 41 | "@compodoc/compodoc": "^1.1.26", 42 | "@eslint/eslintrc": "^3.2.0", 43 | "@eslint/js": "^9.18.0", 44 | "@segment/analytics-next": "^1.76.1", 45 | "@types/jasmine": "^5.1.5", 46 | "@types/node": "^20.17.12", 47 | "@typescript-eslint/eslint-plugin": "^8.20.0", 48 | "@typescript-eslint/parser": "^8.20.0", 49 | "codelyzer": "^6.0.2", 50 | "core-js": "^3.40.0", 51 | "eslint": "^9.18.0", 52 | "jasmine-core": "~5.5.0", 53 | "jasmine-spec-reporter": "~7.0.0", 54 | "karma": "^6.4.4", 55 | "karma-chrome-launcher": "~3.2.0", 56 | "karma-cli": "~2.0.0", 57 | "karma-coverage-istanbul-reporter": "^3.0.3", 58 | "karma-jasmine": "^5.1.0", 59 | "karma-jasmine-html-reporter": "^2.1.0", 60 | "ng-packagr": "^19.0.1", 61 | "protractor": "~7.0.0", 62 | "rxjs": "^7.8.1", 63 | "ts-node": "^10.9.2", 64 | "tslib": "^2.8.1", 65 | "typescript": "~5.6.3", 66 | "zone.js": "0.15.0" 67 | }, 68 | "engines": { 69 | "node": ">=18.19.1" 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/.yarn/install-state.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opendecide/ngx-segment-analytics/71517298684766bfef9daedda2ab4938400de4d3/src/.yarn/install-state.gz -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | # ngx-segment-analytics 2 | 3 | [![Build Status](https://travis-ci.org/opendecide/ngx-segment-analytics.svg?branch=master)](https://travis-ci.org/opendecide/ngx-segment-analytics) 4 | [![GitHub Downloads All Releases](https://img.shields.io/github/downloads/opendecide/ngx-segment-analytics/total.svg)](https://github.com/opendecide/ngx-segment-analytics) 5 | [![npm Downloads All Releases](https://img.shields.io/npm/dw/ngx-segment-analytics.svg)](https://www.npmjs.com/package/ngx-segment-analytics) 6 | [![npm Version](https://img.shields.io/npm/v/ngx-segment-analytics.svg)](https://www.npmjs.com/package/ngx-segment-analytics) 7 | [![node Version Required](https://img.shields.io/node/v/ngx-segment-analytics.svg)](https://www.npmjs.com/package/ngx-segment-analytics) 8 | 9 | This Angular module provides an API for Segment using the `analytics.js` official library. 10 | 11 | ## Installation 12 | 13 | To install this library, run: 14 | 15 | ```bash 16 | $ npm install --save ngx-segment-analytics 17 | ``` 18 | 19 | ## Consuming Segment 20 | 21 | Add the `SegmentModule` to your Angular `AppModule`: 22 | 23 | ```typescript 24 | import { BrowserModule } from '@angular/platform-browser'; 25 | import { NgModule } from '@angular/core'; 26 | 27 | import { AppComponent } from './app.component'; 28 | 29 | // Import the Segment module 30 | import { SegmentModule } from 'ngx-segment-analytics'; 31 | 32 | @NgModule({ 33 | declarations: [ 34 | AppComponent 35 | ], 36 | imports: [ 37 | BrowserModule, 38 | // Segment Importation 39 | SegmentModule.forRoot({ apiKey: 'YOUR_WRITE_APIKEY', debug: true, loadOnInitialization: true }) 40 | ], 41 | providers: [], 42 | bootstrap: [AppComponent] 43 | }) 44 | export class AppModule { } 45 | ``` 46 | 47 | You can use the `SegmentService` in any constructor as a injected service : 48 | 49 | ```typescript 50 | import { Component, OnInit } from '@angular/core'; 51 | import { SegmentService } from 'ngx-segment-analytics'; 52 | @Component({ 53 | selector: 'hero', 54 | templateUrl: './hero.component.html', 55 | styleUrls: ['./hero.component.css'] 56 | }) 57 | export class HeroComponent implements OnInit { 58 | 59 | constructor(private segment: SegmentService) { } 60 | 61 | public ngOnInit() { 62 | this.segment.track('load an hero') 63 | .then(() => console.log("Event sended")); 64 | } 65 | 66 | } 67 | ``` 68 | 69 | ## Documentation 70 | 71 | A full documentation is available [here](https://opendecide.github.io/ngx-segment-analytics/) 72 | 73 | ## API 74 | 75 | This API is compatible with `analytics.js` but returns `Promises` instead of taking `callbacks` in parameters. 76 | 77 | ```typescript 78 | load(apiKey: string, options: any); 79 | get plugins: {[pluginName :string]: SegmentPlugin}; 80 | identify(userId?: string, traits?: any, options?: any): Promise; 81 | track(event: string, properties?: any, options?: any): Promise; 82 | page(category?: string, name?: string, properties?: any, options?: any): Promise; 83 | group(groupId: string, traits?: any): Promise; 84 | alias(userId: string, previousId?: string, options?: any): Promise; 85 | ready(): Promise; 86 | user(): any; 87 | id(): any; 88 | traits(): any; 89 | reset(): void; 90 | debug(enabled?: boolean): void; 91 | on(method: string, callback: (event?: string, properties?: any, options?: any) => any): void; 92 | trackLink(elements: HTMLElement | HTMLElement[], event: string | Function, properties?: Object | Function): void; 93 | trackForm(forms: HTMLElement | HTMLElement[], event: string | Function, properties?: Object | Function): void; 94 | timeout(timeout: number): void; 95 | ``` 96 | 97 | ## Development 98 | 99 | To lint all `*.ts` files: 100 | 101 | ```bash 102 | $ npm run lint 103 | ``` 104 | 105 | To generate all `*.js`, `*.d.ts` and `*.metadata.json` files: 106 | 107 | ```bash 108 | $ npm run build 109 | ``` 110 | 111 | To publish on npmjs registry : 112 | ```bash 113 | $ npm publish dist 114 | ``` 115 | 116 | 117 | ## License 118 | 119 | MIT ©2017 [OpenDecide](https://www.opendecide.com) 120 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ngx-segment-analytics.module'; 2 | export * from './ngx-segment-analytics.service'; 3 | export * from './ngx-segment-analytics.config'; 4 | export * from './window-wrapper'; 5 | -------------------------------------------------------------------------------- /src/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./../node_modules/ng-packagr/ng-package.schema.json", 3 | "allowedNonPeerDependencies": [], 4 | "dest": "../dist", 5 | "lib": { 6 | "entryFile": "index.ts" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/ngx-segment-analytics.config.ts: -------------------------------------------------------------------------------- 1 | import {InjectionToken} from '@angular/core'; 2 | import type {Plugin} from '@segment/analytics-next'; 3 | 4 | /** 5 | * Segment Configuration Interface 6 | */ 7 | export interface SegmentConfig { 8 | /** API Key for Segment.io */ 9 | apiKey?: string; 10 | /** Debug mode status */ 11 | debug?: boolean; 12 | /** Load Segment configuration on initialization */ 13 | loadOnInitialization?: boolean; 14 | /** 15 | * Segment Host if requests are proxied 16 | * @deprecated Use cdnURL instead. 17 | **/ 18 | segmentHost?: string; 19 | /** 20 | * Segment Custom URI 21 | * @deprecated Use cdnURL instead. 22 | **/ 23 | segmentUri?: string; 24 | /** CDN host if requests are proxied */ 25 | cdnURL?: string; 26 | /** Plugins **/ 27 | plugins?: Plugin[]; 28 | } 29 | 30 | /** Segment Configuration Injection Token */ 31 | export const SEGMENT_CONFIG: InjectionToken = new InjectionToken('ngx-segment-analytics.config'); 32 | 33 | export const DEFAULT_CONFIG: SegmentConfig = { 34 | debug: false, 35 | loadOnInitialization: true, // Compatibility < 1.2.5 36 | cdnURL: 'https://cdn.segment.com', 37 | segmentUri: '/analytics.js/v1/$API_KEY$/analytics.min.js', 38 | plugins: [], 39 | }; 40 | -------------------------------------------------------------------------------- /src/ngx-segment-analytics.module.ts: -------------------------------------------------------------------------------- 1 | import {ModuleWithProviders, NgModule, Optional, SkipSelf} from '@angular/core'; 2 | import {CommonModule} from '@angular/common'; 3 | import {SegmentService} from './ngx-segment-analytics.service'; 4 | import {SEGMENT_CONFIG, SegmentConfig} from './ngx-segment-analytics.config'; 5 | 6 | /** 7 | * Segment Module 8 | */ 9 | @NgModule({ 10 | imports: [CommonModule], 11 | }) 12 | export class SegmentModule { 13 | 14 | /** 15 | * Segment Module Initialisation 16 | * 17 | * @param config Segment Configuration 18 | * @returns Segment Module 19 | */ 20 | public static forRoot(config?: SegmentConfig): ModuleWithProviders { 21 | return { 22 | ngModule: SegmentModule, 23 | providers: [ 24 | {provide: SEGMENT_CONFIG, useValue: config}, 25 | SegmentService, 26 | ], 27 | }; 28 | } 29 | 30 | /** 31 | * Segment Module Constructor 32 | * 33 | * @param parentModule Must be null 34 | */ 35 | constructor(@Optional() @SkipSelf() parentModule: SegmentModule) { 36 | if (parentModule) { 37 | throw new Error('SegmentModule is already loaded. Import it in the AppModule only'); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ngx-segment-analytics", 3 | "version": "19.0.1", 4 | "description": "Segment Analytics for Angular", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/opendecide/ngx-segment-analytics" 8 | }, 9 | "author": { 10 | "name": "OpenDecide", 11 | "email": "contact@opendecide.com" 12 | }, 13 | "keywords": [ 14 | "angular", 15 | "segment" 16 | ], 17 | "license": "MIT", 18 | "bugs": { 19 | "url": "https://github.com/opendecide/ngx-segment-analytics/issues" 20 | }, 21 | "peerDependencies": { 22 | "@angular/common": ">=12.0.0 <20.0.0", 23 | "@angular/core": ">=12.0.0 <20.0.0", 24 | "@segment/analytics-next": "^1.70.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/window-wrapper.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from '@angular/core'; 2 | import type { AnalyticsSnippet } from '@segment/analytics-next'; 3 | 4 | /** 5 | * Window Wrapper for Angular AOT 6 | */ 7 | @Injectable() 8 | export class WindowWrapper { 9 | /** Segment Analytics.js instance */ 10 | public analytics: AnalyticsSnippet; 11 | } 12 | -------------------------------------------------------------------------------- /src/yarn.lock: -------------------------------------------------------------------------------- 1 | # This file is generated by running "yarn install" inside your project. 2 | # Manual changes might be lost - proceed with caution! 3 | 4 | __metadata: 5 | version: 6 6 | 7 | "ngx-segment-analytics@workspace:.": 8 | version: 0.0.0-use.local 9 | resolution: "ngx-segment-analytics@workspace:." 10 | peerDependencies: 11 | "@angular/common": ">=12.0.0 <18.0.0" 12 | "@angular/core": ">=12.0.0 <18.0.0" 13 | "@segment/analytics-next": ^1.35.1 14 | languageName: unknown 15 | linkType: soft 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./src", 4 | "module": "es2020", 5 | "target": "es2015", 6 | "experimentalDecorators": true, 7 | "moduleResolution": "node", 8 | "rootDir": "./src", 9 | "lib": [ 10 | "es2018", 11 | "dom" 12 | ], 13 | "skipLibCheck": true, 14 | "types": [] 15 | } 16 | } 17 | --------------------------------------------------------------------------------