0.0.148 • Published 2 days ago

be-hive v0.0.148

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

be-hive WIP

Published on webcomponents.org How big is this package in your project? NPM version

Inheriting behiviors

be-hive lets it snow in August.

be-hive allows us to manage and coordinate the family, or HTML frimework of be-enhanced custom enhancements.

Without be-hive, the developer is burdened with plopping an instance of each enhancement inside each shadow DOM realm.

With the help of the be-hive component, the developer only has to plop a single instance of be-hive inside the Shadow DOM realm, like so:

<be-hive></be-hive>

This signals that the Shadow DOM realm is opting-in, and allowing element behiviors, and will inherit all the behiviors from the parent Shadow DOM realm, by default.

But the child Shadow DOM realm can develop a personality of its own by:

  1. Adding additional behiviors by adding specific be-decorated elements inside the be-hive instance tag.
  2. Avoiding naming conflicts by overriding the attribute associated with the inherited behivior.
  3. Preventing inheriting unwanted behiviors from affecting the child Shadow DOM realm.
  4. Start over. Only decorator elements manually added inside the Shadow DOM (preferably inside the be-hive tag, for inheritance to work within)

Syntax for customizations of inherited behiviors TODO

<be-hive overrides='{
    "be-sharing":{
        "becomes": "be-familial"
    },
    "be-gracious": {
        "becomes": "be-respectful"
    },
    "be-disobedient-without-facing-the-consequences": {
        "block": "true"
    }
}'></be-hive>

Be like Sirius Black

If the inherited behiviors are all just too odious to inherit, there's an option to start again:

<be-hive be-severed>
</be-hive>

Adding back a personality trait Untested

If one Shadow DOM blocks an inherited behivior, child Shadow DOMs can bring it back within their (and descendent) shadow DOM realms thusly:

<be-hive overrides='{
    "be-disobedient-without-facing-the-consequences": {
        "unblock": "true"
    }
}'></be-hive>

API

be-hiviors are registered via function:

register(ifWantsToBe: string, upgrade: string, extTagName: string);

in be-hive/register.js

be-hive then determines which be-hiviors to inherit.

Behivior aspects Untested

There may be some cases, especially for enhancements with many equally important parameters where a developer may prefer to break up the settings into separate attributes. Here's an example where I can definitely see the appeal. So instead of:

<time lang="ar-EG" datetime=2011-11-18T14:54:39.929Z be-intl='{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }'></time>

we can write:

<time lang="ar-EG" 
    datetime=2011-11-18T14:54:39.929Z 
    be-intl-weekday=long be-intl-year=numeric be-intl-month=long
    be-intl-day=numeric>
</time>

This is especially useful in environments where the consumer of the behivior prefers to use attributes, rather than properties, for updating a property of the behivior.

For this, we can add a fourth parameter to our register function:

register(ifWantsToBe: string, upgrade: string, extTagName: string, aspects: string[]);

So for the example above, this would look like:

register('intl', 'time', 'be-intl', ['weekday', 'year', 'month', 'day']);
0.0.148

2 days ago

0.0.147

2 days ago

0.0.146

3 days ago

0.0.145

18 days ago

0.0.144

18 days ago

0.0.142

1 month ago

0.0.143

1 month ago

0.0.141

2 months ago

0.0.140

2 months ago

0.0.139

2 months ago

0.0.138

2 months ago

0.0.137

2 months ago

0.0.136

2 months ago

0.0.135

3 months ago

0.0.134

3 months ago

0.0.133

4 months ago

0.0.131

4 months ago

0.0.132

4 months ago

0.0.130

4 months ago

0.0.129

4 months ago

0.0.128

4 months ago

0.0.117

9 months ago

0.0.116

10 months ago

0.0.115

10 months ago

0.0.114

10 months ago

0.0.119

8 months ago

0.0.118

8 months ago

0.0.113

10 months ago

0.0.112

10 months ago

0.0.111

10 months ago

0.0.127

6 months ago

0.0.126

6 months ago

0.0.125

6 months ago

0.0.120

8 months ago

0.0.124

6 months ago

0.0.123

8 months ago

0.0.122

8 months ago

0.0.121

8 months ago

0.0.109

11 months ago

0.0.108

11 months ago

0.0.110

11 months ago

0.0.106

11 months ago

0.0.105

11 months ago

0.0.104

11 months ago

0.0.103

11 months ago

0.0.107

11 months ago

0.0.102

11 months ago

0.0.101

11 months ago

0.0.100

11 months ago

0.0.95

12 months ago

0.0.96

11 months ago

0.0.97

11 months ago

0.0.98

11 months ago

0.0.99

11 months ago

0.0.93

12 months ago

0.0.94

12 months ago

0.0.84

1 year ago

0.0.85

1 year ago

0.0.86

1 year ago

0.0.87

1 year ago

0.0.88

1 year ago

0.0.89

1 year ago

0.0.83

1 year ago

0.0.90

1 year ago

0.0.91

1 year ago

0.0.92

1 year ago

0.0.80

1 year ago

0.0.81

1 year ago

0.0.82

1 year ago

0.0.79

1 year ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.78

1 year ago

0.0.70

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.64

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.67

2 years ago

0.0.68

2 years ago

0.0.69

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.47

2 years ago

0.0.59

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.46

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.34

2 years ago

0.0.14

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago